- java.lang.Object
-
- com.io7m.changelog.core.CVersionText
-
- All Implemented Interfaces:
CVersionTextType,CVersionType,Comparable<CVersionType>
public final class CVersionText extends Object implements CVersionTextType
The type of arbitrary lexicographically ordered version strings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCVersionText.BuilderBuilds instances of typeCVersionText.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CVersionText.Builderbuilder()Creates a builder forCVersionText.static CVersionTextcopyOf(CVersionTextType instance)Creates an immutable copy of aCVersionTextTypevalue.booleanequals(Object another)This instance is equal to all instances ofCVersionTextthat have equal attribute values.inthashCode()Computes a hash code from attributes:text.static CVersionTextof(String text)Construct a new immutableCVersionTextinstance.Stringtext()StringtoString()Prints the immutable valueCVersionTextwith attribute values.CVersionTextwithText(String value)Copy the current immutable object by setting a value for thetextattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.changelog.core.CVersionTextType
compareTo, toVersionString, versionAccept
-
-
-
-
Method Detail
-
text
public String text()
- Specified by:
textin interfaceCVersionTextType- Returns:
- The version number text
-
withText
public final CVersionText withText(String value)
Copy the current immutable object by setting a value for thetextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(Object another)
This instance is equal to all instances ofCVersionTextthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:text.
-
toString
public String toString()
Prints the immutable valueCVersionTextwith attribute values.
-
of
public static CVersionText of(String text)
Construct a new immutableCVersionTextinstance.- Parameters:
text- The value for thetextattribute- Returns:
- An immutable CVersionText instance
-
copyOf
public static CVersionText copyOf(CVersionTextType instance)
Creates an immutable copy of aCVersionTextTypevalue. 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 CVersionText instance
-
builder
public static CVersionText.Builder builder()
Creates a builder forCVersionText.- Returns:
- A new CVersionText builder
-
-