Record Class ParameterSetDescriptor.Template<S extends AlgorithmKeySpec>
java.lang.Object
java.lang.Record
zeroecho.core.ParameterSetDescriptor.Template<S>
- Type Parameters:
S- theAlgorithmKeySpectype produced by the factory- Record Components:
id- nonblank machine identifierdisplayName- nonblank display labelsecurityLevel- security estimateparameters- ordered presentation metadatafactory- factory wrapped with centralized validation
- All Implemented Interfaces:
ParameterSetDescriptor<S>
- Enclosing interface:
ParameterSetDescriptor<S extends AlgorithmKeySpec>
public static record ParameterSetDescriptor.Template<S extends AlgorithmKeySpec>(String id, String displayName, SecurityLevel securityLevel, List<TemplateParameter> parameters, Function<Map<String,Object>, S extends AlgorithmKeySpec> factory)
extends Record
implements ParameterSetDescriptor<S>
A parameterized family of parameter sets driven by user-supplied arguments.
Use this variant when the parameter space is too large to enumerate (e.g.,
RSA with an arbitrary key size, HMAC with an arbitrary MAC name and key
length). The caller supplies a Map<String, Object> keyed by
TemplateParameter.name() values and the factory() produces
the concrete spec.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface ParameterSetDescriptor
ParameterSetDescriptor.Concrete<S>, ParameterSetDescriptor.Template<S> -
Constructor Summary
ConstructorsConstructorDescriptionTemplate(String id, String displayName, SecurityLevel securityLevel, List<TemplateParameter> parameters, Function<Map<String, Object>, S> factory) Snapshots metadata and validates argument names and types before factory invocation.Template(String id, String displayName, SecurityLevel securityLevel, List<TemplateParameter> parameters, List<ParameterConstraint> constraints, Function<Map<String, Object>, S> factory) Creates a template with a complete, ordered validation schema. -
Method Summary
Modifier and TypeMethodDescriptionReturns immutable ordered constraints.Returns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.factory()Returns the value of thefactoryrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theparametersrecord component.Returns the value of thesecurityLevelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Template
public Template(String id, String displayName, SecurityLevel securityLevel, List<TemplateParameter> parameters, Function<Map<String, Object>, S> factory) Snapshots metadata and validates argument names and types before factory invocation. Without an explicit schema, omitted arguments remain the delegate's responsibility; descriptions are never parsed for constraints.- Throws:
NullPointerException- if any field isnullIllegalArgumentException- if identifiers are blank or names repeat
-
Template
public Template(String id, String displayName, SecurityLevel securityLevel, List<TemplateParameter> parameters, List<ParameterConstraint> constraints, Function<Map<String, Object>, S> factory) Creates a template with a complete, ordered validation schema. The factory rejects unknown, missing, null, wrongly typed and out-of-range arguments withIllegalArgumentExceptionbefore invoking the delegate. The original five-argument constructor preserves legacy omission behavior; it cannot infer defaults or required flags from descriptions.- Parameters:
id- machine identifierdisplayName- nonblank labelsecurityLevel- security estimateparameters- ordered presentation metadataconstraints- ordered constraints matching the parametersfactory- specification factory, receiving an immutable validated map- Throws:
IllegalArgumentException- if the schema is inconsistentNullPointerException- if a required constructor argument is null
-
-
Method Details
-
constraints
Returns immutable ordered constraints. Legacy metadata uses LEGACY kind and optional parameters; omission remains the original factory's concern.- Returns:
- the validation schema
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceParameterSetDescriptor<S extends AlgorithmKeySpec>- Returns:
- the value of the
idrecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Specified by:
displayNamein interfaceParameterSetDescriptor<S extends AlgorithmKeySpec>- Returns:
- the value of the
displayNamerecord component
-
securityLevel
Returns the value of thesecurityLevelrecord component.- Specified by:
securityLevelin interfaceParameterSetDescriptor<S extends AlgorithmKeySpec>- Returns:
- the value of the
securityLevelrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
factory
-