Class SMFSchema

  • All Implemented Interfaces:
    SMFSchemaType

    public final class SMFSchema
    extends java.lang.Object
    implements SMFSchemaType
    The type of schemas.
    • Method Detail

      • withSchemaIdentifier

        public final SMFSchema withSchemaIdentifier​(SMFSchemaIdentifier value)
        Copy the current immutable object by setting a value for the schemaIdentifier attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for schemaIdentifier
        Returns:
        A modified copy of the this object
      • withRequiredAttributes

        public final SMFSchema withRequiredAttributes​(java.util.Map<? extends SMFAttributeName,​? extends SMFSchemaAttribute> entries)
        Copy the current immutable object by replacing the requiredAttributes map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the requiredAttributes map
        Returns:
        A modified copy of this object
      • withOptionalAttributes

        public final SMFSchema withOptionalAttributes​(java.util.Map<? extends SMFAttributeName,​? extends SMFSchemaAttribute> entries)
        Copy the current immutable object by replacing the optionalAttributes map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the optionalAttributes map
        Returns:
        A modified copy of this object
      • withRequiredCoordinateSystem

        public final SMFSchema withRequiredCoordinateSystem​(SMFCoordinateSystem value)
        Copy the current immutable object by setting a present value for the optional requiredCoordinateSystem attribute.
        Parameters:
        value - The value for requiredCoordinateSystem
        Returns:
        A modified copy of this object
      • withRequiredCoordinateSystem

        public final SMFSchema withRequiredCoordinateSystem​(java.util.Optional<? extends SMFCoordinateSystem> optional)
        Copy the current immutable object by setting an optional value for the requiredCoordinateSystem attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for requiredCoordinateSystem
        Returns:
        A modified copy of this object
      • withAllowExtraAttributes

        public final SMFSchema withAllowExtraAttributes​(SMFSchemaAllowExtraAttributes value)
        Copy the current immutable object by setting a value for the allowExtraAttributes attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for allowExtraAttributes
        Returns:
        A modified copy of the this object
      • withRequireTriangles

        public final SMFSchema withRequireTriangles​(SMFSchemaRequireTriangles value)
        Copy the current immutable object by setting a value for the requireTriangles attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for requireTriangles
        Returns:
        A modified copy of the this object
      • withRequireVertices

        public final SMFSchema withRequireVertices​(SMFSchemaRequireVertices value)
        Copy the current immutable object by setting a value for the requireVertices attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for requireVertices
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(java.lang.Object another)
        This instance is equal to all instances of SMFSchema that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: schemaIdentifier, requiredAttributes, optionalAttributes, requiredCoordinateSystem, allowExtraAttributes, requireTriangles, requireVertices.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value SMFSchema with attribute values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the value
      • of

        public static SMFSchema of​(SMFSchemaIdentifier schemaIdentifier,
                                   java.util.Map<? extends SMFAttributeName,​? extends SMFSchemaAttribute> requiredAttributes,
                                   java.util.Map<? extends SMFAttributeName,​? extends SMFSchemaAttribute> optionalAttributes,
                                   java.util.Optional<? extends SMFCoordinateSystem> requiredCoordinateSystem,
                                   SMFSchemaAllowExtraAttributes allowExtraAttributes,
                                   SMFSchemaRequireTriangles requireTriangles,
                                   SMFSchemaRequireVertices requireVertices)
        Construct a new immutable SMFSchema instance.
        Parameters:
        schemaIdentifier - The value for the schemaIdentifier attribute
        requiredAttributes - The value for the requiredAttributes attribute
        optionalAttributes - The value for the optionalAttributes attribute
        requiredCoordinateSystem - The value for the requiredCoordinateSystem attribute
        allowExtraAttributes - The value for the allowExtraAttributes attribute
        requireTriangles - The value for the requireTriangles attribute
        requireVertices - The value for the requireVertices attribute
        Returns:
        An immutable SMFSchema instance
      • copyOf

        public static SMFSchema copyOf​(SMFSchemaType instance)
        Creates an immutable copy of a SMFSchemaType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable SMFSchema instance
      • builder

        public static SMFSchema.Builder builder()
        Creates a builder for SMFSchema.
         SMFSchema.builder()
            .setSchemaIdentifier(com.io7m.smfj.core.SMFSchemaIdentifier) // required schemaIdentifier
            .putRequiredAttributes|putAllRequiredAttributes(com.io7m.smfj.core.SMFAttributeName => SMFSchemaAttribute) // requiredAttributes mappings
            .putOptionalAttributes|putAllOptionalAttributes(com.io7m.smfj.core.SMFAttributeName => SMFSchemaAttribute) // optionalAttributes mappings
            .setRequiredCoordinateSystem(com.io7m.smfj.core.SMFCoordinateSystem) // optional requiredCoordinateSystem
            .setAllowExtraAttributes(com.io7m.smfj.validation.api.SMFSchemaAllowExtraAttributes) // optional allowExtraAttributes
            .setRequireTriangles(com.io7m.smfj.validation.api.SMFSchemaRequireTriangles) // optional requireTriangles
            .setRequireVertices(com.io7m.smfj.validation.api.SMFSchemaRequireVertices) // optional requireVertices
            .build();
         
        Returns:
        A new SMFSchema builder