Package com.io7m.smfj.validation.api
Class SMFSchema.Builder
- java.lang.Object
-
- com.io7m.smfj.validation.api.SMFSchema.Builder
-
- Enclosing class:
- SMFSchema
public static final class SMFSchema.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SMFSchemabuild()Builds a newSMFSchema.SMFSchema.Builderfrom(SMFSchemaType instance)Fill a builder with attribute values from the providedSMFSchemaTypeinstance.SMFSchema.BuilderputAllOptionalAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)Put all mappings from the specified map as entries tooptionalAttributesmap.SMFSchema.BuilderputAllRequiredAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)Put all mappings from the specified map as entries torequiredAttributesmap.SMFSchema.BuilderputOptionalAttributes(SMFAttributeName key, SMFSchemaAttribute value)Put one entry to theoptionalAttributesmap.SMFSchema.BuilderputOptionalAttributes(java.util.Map.Entry<? extends SMFAttributeName,? extends SMFSchemaAttribute> entry)Put one entry to theoptionalAttributesmap.SMFSchema.BuilderputRequiredAttributes(SMFAttributeName key, SMFSchemaAttribute value)Put one entry to therequiredAttributesmap.SMFSchema.BuilderputRequiredAttributes(java.util.Map.Entry<? extends SMFAttributeName,? extends SMFSchemaAttribute> entry)Put one entry to therequiredAttributesmap.SMFSchema.BuildersetAllowExtraAttributes(SMFSchemaAllowExtraAttributes allowExtraAttributes)Initializes the value for theallowExtraAttributesattribute.SMFSchema.BuildersetOptionalAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)Sets or replaces all mappings from the specified map as entries for theoptionalAttributesmap.SMFSchema.BuildersetRequiredAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)Sets or replaces all mappings from the specified map as entries for therequiredAttributesmap.SMFSchema.BuildersetRequiredCoordinateSystem(SMFCoordinateSystem requiredCoordinateSystem)Initializes the optional valuerequiredCoordinateSystemto requiredCoordinateSystem.SMFSchema.BuildersetRequiredCoordinateSystem(java.util.Optional<? extends SMFCoordinateSystem> requiredCoordinateSystem)Initializes the optional valuerequiredCoordinateSystemto requiredCoordinateSystem.SMFSchema.BuildersetRequireTriangles(SMFSchemaRequireTriangles requireTriangles)Initializes the value for therequireTrianglesattribute.SMFSchema.BuildersetRequireVertices(SMFSchemaRequireVertices requireVertices)Initializes the value for therequireVerticesattribute.SMFSchema.BuildersetSchemaIdentifier(SMFSchemaIdentifier schemaIdentifier)Initializes the value for theschemaIdentifierattribute.
-
-
-
Method Detail
-
from
public final SMFSchema.Builder from(SMFSchemaType instance)
Fill a builder with attribute values from the providedSMFSchemaTypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setSchemaIdentifier
public final SMFSchema.Builder setSchemaIdentifier(SMFSchemaIdentifier schemaIdentifier)
Initializes the value for theschemaIdentifierattribute.- Parameters:
schemaIdentifier- The value for schemaIdentifier- Returns:
thisbuilder for use in a chained invocation
-
putRequiredAttributes
public final SMFSchema.Builder putRequiredAttributes(SMFAttributeName key, SMFSchemaAttribute value)
Put one entry to therequiredAttributesmap.- Parameters:
key- The key in the requiredAttributes mapvalue- The associated value in the requiredAttributes map- Returns:
thisbuilder for use in a chained invocation
-
putRequiredAttributes
public final SMFSchema.Builder putRequiredAttributes(java.util.Map.Entry<? extends SMFAttributeName,? extends SMFSchemaAttribute> entry)
Put one entry to therequiredAttributesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
setRequiredAttributes
public final SMFSchema.Builder setRequiredAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Sets or replaces all mappings from the specified map as entries for therequiredAttributesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the requiredAttributes map- Returns:
thisbuilder for use in a chained invocation
-
putAllRequiredAttributes
public final SMFSchema.Builder putAllRequiredAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Put all mappings from the specified map as entries torequiredAttributesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the requiredAttributes map- Returns:
thisbuilder for use in a chained invocation
-
putOptionalAttributes
public final SMFSchema.Builder putOptionalAttributes(SMFAttributeName key, SMFSchemaAttribute value)
Put one entry to theoptionalAttributesmap.- Parameters:
key- The key in the optionalAttributes mapvalue- The associated value in the optionalAttributes map- Returns:
thisbuilder for use in a chained invocation
-
putOptionalAttributes
public final SMFSchema.Builder putOptionalAttributes(java.util.Map.Entry<? extends SMFAttributeName,? extends SMFSchemaAttribute> entry)
Put one entry to theoptionalAttributesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
setOptionalAttributes
public final SMFSchema.Builder setOptionalAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Sets or replaces all mappings from the specified map as entries for theoptionalAttributesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the optionalAttributes map- Returns:
thisbuilder for use in a chained invocation
-
putAllOptionalAttributes
public final SMFSchema.Builder putAllOptionalAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Put all mappings from the specified map as entries tooptionalAttributesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the optionalAttributes map- Returns:
thisbuilder for use in a chained invocation
-
setRequiredCoordinateSystem
public final SMFSchema.Builder setRequiredCoordinateSystem(SMFCoordinateSystem requiredCoordinateSystem)
Initializes the optional valuerequiredCoordinateSystemto requiredCoordinateSystem.- Parameters:
requiredCoordinateSystem- The value for requiredCoordinateSystem- Returns:
thisbuilder for chained invocation
-
setRequiredCoordinateSystem
public final SMFSchema.Builder setRequiredCoordinateSystem(java.util.Optional<? extends SMFCoordinateSystem> requiredCoordinateSystem)
Initializes the optional valuerequiredCoordinateSystemto requiredCoordinateSystem.- Parameters:
requiredCoordinateSystem- The value for requiredCoordinateSystem- Returns:
thisbuilder for use in a chained invocation
-
setAllowExtraAttributes
public final SMFSchema.Builder setAllowExtraAttributes(SMFSchemaAllowExtraAttributes allowExtraAttributes)
Initializes the value for theallowExtraAttributesattribute.If not set, this attribute will have a default value as returned by the initializer of
allowExtraAttributes.- Parameters:
allowExtraAttributes- The value for allowExtraAttributes- Returns:
thisbuilder for use in a chained invocation
-
setRequireTriangles
public final SMFSchema.Builder setRequireTriangles(SMFSchemaRequireTriangles requireTriangles)
Initializes the value for therequireTrianglesattribute.If not set, this attribute will have a default value as returned by the initializer of
requireTriangles.- Parameters:
requireTriangles- The value for requireTriangles- Returns:
thisbuilder for use in a chained invocation
-
setRequireVertices
public final SMFSchema.Builder setRequireVertices(SMFSchemaRequireVertices requireVertices)
Initializes the value for therequireVerticesattribute.If not set, this attribute will have a default value as returned by the initializer of
requireVertices.- Parameters:
requireVertices- The value for requireVertices- Returns:
thisbuilder for use in a chained invocation
-
-