Class MNames
java.lang.Object
com.io7m.montarre.api.MNames
- All Implemented Interfaces:
MNamesType
Name information.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic MNames.Builderbuilder()Creates a builder forMNames.static MNamescopyOf(MNamesType instance) Creates an immutable copy of aMNamesTypevalue.booleanThis instance is equal to all instances ofMNamesthat have equal attribute values.inthashCode()Computes a hash code from attributes:packageName,humanName,shortName,id.id()toString()Prints the immutable valueMNameswith attribute values.final MNameswithHumanName(String value) Copy the current immutable object by setting a value for thehumanNameattribute.final MNameswithPackageName(MPackageName value) Copy the current immutable object by setting a value for thepackageNameattribute.final MNameswithShortName(MShortName value) Copy the current immutable object by setting a value for theshortNameattribute.
-
Method Details
-
packageName
- Specified by:
packageNamein interfaceMNamesType- Returns:
- The package name
-
humanName
- Specified by:
humanNamein interfaceMNamesType- Returns:
- The humanly-readable application name
-
shortName
- Specified by:
shortNamein interfaceMNamesType- Returns:
- The package short name
-
id
- Specified by:
idin interfaceMNamesType- Returns:
- A name-based UUID from the package name
-
withPackageName
Copy the current immutable object by setting a value for thepackageNameattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for packageName- Returns:
- A modified copy or the
thisobject
-
withHumanName
-
withShortName
Copy the current immutable object by setting a value for theshortNameattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for shortName- Returns:
- A modified copy or the
thisobject
-
equals
-
hashCode
-
toString
-
copyOf
Creates an immutable copy of aMNamesTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable MNames instance
-
builder
Creates a builder forMNames.MNames.builder() .setPackageName(com.io7m.montarre.api.MPackageName) // required
packageName.setHumanName(String) // optionalhumanName.setShortName(com.io7m.montarre.api.MShortName) // requiredshortName.build();- Returns:
- A new MNames builder
-