Class MManifest.Builder
java.lang.Object
com.io7m.montarre.api.MManifest.Builder
- Enclosing class:
MManifest
-
Method Summary
Modifier and TypeMethodDescriptionfinal MManifest.BuilderaddAllItems(Iterable<? extends MManifestItemType> elements) Adds elements toitemslist.final MManifest.BuilderaddItems(MManifestItemType element) Adds one element toitemslist.final MManifest.BuilderaddItems(MManifestItemType... elements) Adds elements toitemslist.build()Builds a newMManifest.final MManifest.Builderfrom(MManifestType instance) Fill a builder with attribute values from the providedMManifestTypeinstance.final MManifest.BuildersetItems(Iterable<? extends MManifestItemType> elements) Sets or replaces all elements foritemslist.
-
Method Details
-
from
Fill a builder with attribute values from the providedMManifestTypeinstance. 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
-
addItems
Adds one element toitemslist.- Parameters:
element- A items element- Returns:
thisbuilder for use in a chained invocation
-
addItems
Adds elements toitemslist.- Parameters:
elements- An array of items elements- Returns:
thisbuilder for use in a chained invocation
-
setItems
Sets or replaces all elements foritemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
addAllItems
Adds elements toitemslist.- Parameters:
elements- An iterable of items elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newMManifest.- Returns:
- An immutable instance of MManifest
- Throws:
IllegalStateException- if any required attributes are missing
-