Class MLongDescription.Builder
java.lang.Object
com.io7m.montarre.api.MLongDescription.Builder
- Enclosing class:
MLongDescription
Builds instances of type
MLongDescription.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionfinal MLongDescription.BuilderaddAllDescriptions(Iterable<? extends MParagraph> elements) Adds elements todescriptionslist.final MLongDescription.BuilderaddAllFeatures(Iterable<? extends MFeature> elements) Adds elements tofeatureslist.final MLongDescription.BuilderaddDescriptions(MParagraph element) Adds one element todescriptionslist.final MLongDescription.BuilderaddDescriptions(MParagraph... elements) Adds elements todescriptionslist.final MLongDescription.BuilderaddFeatures(MFeature element) Adds one element tofeatureslist.final MLongDescription.BuilderaddFeatures(MFeature... elements) Adds elements tofeatureslist.build()Builds a newMLongDescription.final MLongDescription.Builderfrom(MLongDescriptionType instance) Fill a builder with attribute values from the providedMLongDescriptionTypeinstance.final MLongDescription.BuildersetDescriptions(Iterable<? extends MParagraph> elements) Sets or replaces all elements fordescriptionslist.final MLongDescription.BuildersetFeatures(Iterable<? extends MFeature> elements) Sets or replaces all elements forfeatureslist.final MLongDescription.BuildersetLanguage(MLanguageCode language) Initializes the value for thelanguageattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedMLongDescriptionTypeinstance. 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
-
setLanguage
-
addDescriptions
Adds one element todescriptionslist.- Parameters:
element- A descriptions element- Returns:
thisbuilder for use in a chained invocation
-
addDescriptions
Adds elements todescriptionslist.- Parameters:
elements- An array of descriptions elements- Returns:
thisbuilder for use in a chained invocation
-
setDescriptions
Sets or replaces all elements fordescriptionslist.- Parameters:
elements- An iterable of descriptions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDescriptions
Adds elements todescriptionslist.- Parameters:
elements- An iterable of descriptions elements- Returns:
thisbuilder for use in a chained invocation
-
addFeatures
Adds one element tofeatureslist.- Parameters:
element- A features element- Returns:
thisbuilder for use in a chained invocation
-
addFeatures
Adds elements tofeatureslist.- Parameters:
elements- An array of features elements- Returns:
thisbuilder for use in a chained invocation
-
setFeatures
Sets or replaces all elements forfeatureslist.- Parameters:
elements- An iterable of features elements- Returns:
thisbuilder for use in a chained invocation
-
addAllFeatures
Adds elements tofeatureslist.- Parameters:
elements- An iterable of features elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newMLongDescription.- Returns:
- An immutable instance of MLongDescription
- Throws:
IllegalStateException- if any required attributes are missing
-