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 SMFSchema
build()
Builds a newSMFSchema
.SMFSchema.Builder
from(SMFSchemaType instance)
Fill a builder with attribute values from the providedSMFSchemaType
instance.SMFSchema.Builder
putAllOptionalAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Put all mappings from the specified map as entries tooptionalAttributes
map.SMFSchema.Builder
putAllRequiredAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Put all mappings from the specified map as entries torequiredAttributes
map.SMFSchema.Builder
putOptionalAttributes(SMFAttributeName key, SMFSchemaAttribute value)
Put one entry to theoptionalAttributes
map.SMFSchema.Builder
putOptionalAttributes(java.util.Map.Entry<? extends SMFAttributeName,? extends SMFSchemaAttribute> entry)
Put one entry to theoptionalAttributes
map.SMFSchema.Builder
putRequiredAttributes(SMFAttributeName key, SMFSchemaAttribute value)
Put one entry to therequiredAttributes
map.SMFSchema.Builder
putRequiredAttributes(java.util.Map.Entry<? extends SMFAttributeName,? extends SMFSchemaAttribute> entry)
Put one entry to therequiredAttributes
map.SMFSchema.Builder
setAllowExtraAttributes(SMFSchemaAllowExtraAttributes allowExtraAttributes)
Initializes the value for theallowExtraAttributes
attribute.SMFSchema.Builder
setOptionalAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Sets or replaces all mappings from the specified map as entries for theoptionalAttributes
map.SMFSchema.Builder
setRequiredAttributes(java.util.Map<? extends SMFAttributeName,? extends SMFSchemaAttribute> entries)
Sets or replaces all mappings from the specified map as entries for therequiredAttributes
map.SMFSchema.Builder
setRequiredCoordinateSystem(SMFCoordinateSystem requiredCoordinateSystem)
Initializes the optional valuerequiredCoordinateSystem
to requiredCoordinateSystem.SMFSchema.Builder
setRequiredCoordinateSystem(java.util.Optional<? extends SMFCoordinateSystem> requiredCoordinateSystem)
Initializes the optional valuerequiredCoordinateSystem
to requiredCoordinateSystem.SMFSchema.Builder
setRequireTriangles(SMFSchemaRequireTriangles requireTriangles)
Initializes the value for therequireTriangles
attribute.SMFSchema.Builder
setRequireVertices(SMFSchemaRequireVertices requireVertices)
Initializes the value for therequireVertices
attribute.SMFSchema.Builder
setSchemaIdentifier(SMFSchemaIdentifier schemaIdentifier)
Initializes the value for theschemaIdentifier
attribute.
-
-
-
Method Detail
-
from
public final SMFSchema.Builder from(SMFSchemaType instance)
Fill a builder with attribute values from the providedSMFSchemaType
instance. 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:
this
builder for use in a chained invocation
-
setSchemaIdentifier
public final SMFSchema.Builder setSchemaIdentifier(SMFSchemaIdentifier schemaIdentifier)
Initializes the value for theschemaIdentifier
attribute.- Parameters:
schemaIdentifier
- The value for schemaIdentifier- Returns:
this
builder for use in a chained invocation
-
putRequiredAttributes
public final SMFSchema.Builder putRequiredAttributes(SMFAttributeName key, SMFSchemaAttribute value)
Put one entry to therequiredAttributes
map.- Parameters:
key
- The key in the requiredAttributes mapvalue
- The associated value in the requiredAttributes map- Returns:
this
builder 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 therequiredAttributes
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder 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 therequiredAttributes
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the requiredAttributes map- Returns:
this
builder 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 torequiredAttributes
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the requiredAttributes map- Returns:
this
builder for use in a chained invocation
-
putOptionalAttributes
public final SMFSchema.Builder putOptionalAttributes(SMFAttributeName key, SMFSchemaAttribute value)
Put one entry to theoptionalAttributes
map.- Parameters:
key
- The key in the optionalAttributes mapvalue
- The associated value in the optionalAttributes map- Returns:
this
builder 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 theoptionalAttributes
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder 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 theoptionalAttributes
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the optionalAttributes map- Returns:
this
builder 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 tooptionalAttributes
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the optionalAttributes map- Returns:
this
builder for use in a chained invocation
-
setRequiredCoordinateSystem
public final SMFSchema.Builder setRequiredCoordinateSystem(SMFCoordinateSystem requiredCoordinateSystem)
Initializes the optional valuerequiredCoordinateSystem
to requiredCoordinateSystem.- Parameters:
requiredCoordinateSystem
- The value for requiredCoordinateSystem- Returns:
this
builder for chained invocation
-
setRequiredCoordinateSystem
public final SMFSchema.Builder setRequiredCoordinateSystem(java.util.Optional<? extends SMFCoordinateSystem> requiredCoordinateSystem)
Initializes the optional valuerequiredCoordinateSystem
to requiredCoordinateSystem.- Parameters:
requiredCoordinateSystem
- The value for requiredCoordinateSystem- Returns:
this
builder for use in a chained invocation
-
setAllowExtraAttributes
public final SMFSchema.Builder setAllowExtraAttributes(SMFSchemaAllowExtraAttributes allowExtraAttributes)
Initializes the value for theallowExtraAttributes
attribute.If not set, this attribute will have a default value as returned by the initializer of
allowExtraAttributes
.- Parameters:
allowExtraAttributes
- The value for allowExtraAttributes- Returns:
this
builder for use in a chained invocation
-
setRequireTriangles
public final SMFSchema.Builder setRequireTriangles(SMFSchemaRequireTriangles requireTriangles)
Initializes the value for therequireTriangles
attribute.If not set, this attribute will have a default value as returned by the initializer of
requireTriangles
.- Parameters:
requireTriangles
- The value for requireTriangles- Returns:
this
builder for use in a chained invocation
-
setRequireVertices
public final SMFSchema.Builder setRequireVertices(SMFSchemaRequireVertices requireVertices)
Initializes the value for therequireVertices
attribute.If not set, this attribute will have a default value as returned by the initializer of
requireVertices
.- Parameters:
requireVertices
- The value for requireVertices- Returns:
this
builder for use in a chained invocation
-
-