Package com.io7m.montarre.api
Class MCopying
java.lang.Object
com.io7m.montarre.api.MCopying
- All Implemented Interfaces:
MCopyingType
Copyright and license information.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic MCopying.Builderbuilder()Creates a builder forMCopying.static MCopyingcopyOf(MCopyingType instance) Creates an immutable copy of aMCopyingTypevalue.booleanThis instance is equal to all instances ofMCopyingthat have equal attribute values.inthashCode()Computes a hash code from attributes:license,copyright.license()toString()Prints the immutable valueMCopyingwith attribute values.final MCopyingwithCopyright(String value) Copy the current immutable object by setting a value for thecopyrightattribute.final MCopyingwithLicense(String value) Copy the current immutable object by setting a value for thelicenseattribute.
-
Method Details
-
license
- Specified by:
licensein interfaceMCopyingType- Returns:
- An SPDX license identifier
-
copyright
- Specified by:
copyrightin interfaceMCopyingType- Returns:
- The single-line package copyright string
-
withLicense
Copy the current immutable object by setting a value for thelicenseattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for license- Returns:
- A modified copy of the
thisobject
-
withCopyright
Copy the current immutable object by setting a value for thecopyrightattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for copyright- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofMCopyingthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:license,copyright. -
toString
Prints the immutable valueMCopyingwith attribute values. -
copyOf
Creates an immutable copy of aMCopyingTypevalue. 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 MCopying instance
-
builder
Creates a builder forMCopying.MCopying.builder() .setLicense(String) // requiredlicense.setCopyright(String) // requiredcopyright.build();- Returns:
- A new MCopying builder
-