Package com.io7m.montarre.api
Class MNames.Builder
java.lang.Object
com.io7m.montarre.api.MNames.Builder
- Enclosing class:
MNames
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newMNames.final MNames.Builderfrom(MNamesType instance) Fill a builder with attribute values from the providedMNamesTypeinstance.final MNames.BuildersetHumanName(String humanName) Initializes the value for thehumanNameattribute.final MNames.BuildersetPackageName(MPackageName packageName) Initializes the value for thepackageNameattribute.final MNames.BuildersetShortName(MShortName shortName) Initializes the value for theshortNameattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedMNamesTypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setPackageName
Initializes the value for thepackageNameattribute.- Parameters:
packageName- The value for packageName- Returns:
thisbuilder for use in a chained invocation
-
setHumanName
Initializes the value for thehumanNameattribute.If not set, this attribute will have a default value as returned by the initializer of
humanName.- Parameters:
humanName- The value for humanName- Returns:
thisbuilder for use in a chained invocation
-
setShortName
Initializes the value for theshortNameattribute.- Parameters:
shortName- The value for shortName- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newMNames.- Returns:
- An immutable instance of MNames
- Throws:
IllegalStateException- if any required attributes are missing
-