Record Class ParameterSetDescriptor.Template<S extends AlgorithmKeySpec>

java.lang.Object
java.lang.Record
zeroecho.core.ParameterSetDescriptor.Template<S>
Type Parameters:
S - the AlgorithmKeySpec type produced by the factory
Record Components:
id - nonblank machine identifier
displayName - nonblank display label
securityLevel - security estimate
parameters - ordered presentation metadata
factory - 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
  • 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 is null
      IllegalArgumentException - 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 with IllegalArgumentException before invoking the delegate. The original five-argument constructor preserves legacy omission behavior; it cannot infer defaults or required flags from descriptions.
      Parameters:
      id - machine identifier
      displayName - nonblank label
      securityLevel - security estimate
      parameters - ordered presentation metadata
      constraints - ordered constraints matching the parameters
      factory - specification factory, receiving an immutable validated map
      Throws:
      IllegalArgumentException - if the schema is inconsistent
      NullPointerException - if a required constructor argument is null
  • Method Details

    • constraints

      public List<ParameterConstraint> 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Specified by:
      id in interface ParameterSetDescriptor<S extends AlgorithmKeySpec>
      Returns:
      the value of the id record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Specified by:
      displayName in interface ParameterSetDescriptor<S extends AlgorithmKeySpec>
      Returns:
      the value of the displayName record component
    • securityLevel

      public SecurityLevel securityLevel()
      Returns the value of the securityLevel record component.
      Specified by:
      securityLevel in interface ParameterSetDescriptor<S extends AlgorithmKeySpec>
      Returns:
      the value of the securityLevel record component
    • parameters

      public List<TemplateParameter> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • factory

      public Function<Map<String,Object>, S> factory()
      Returns the value of the factory record component.
      Returns:
      the value of the factory record component