Package com.io7m.jproperties.monad
Class JPropertyError
java.lang.Object
com.io7m.jproperties.monad.JPropertyError
- All Implemented Interfaces:
JPropertyParseMonadType.JPropertyErrorType
public final class JPropertyError extends java.lang.Object implements JPropertyParseMonadType.JPropertyErrorType
The type of parse errors.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJPropertyError.BuilderBuilds instances of typeJPropertyError. -
Method Summary
Modifier and Type Method Description static JPropertyError.Builderbuilder()Creates a builder forJPropertyError.static JPropertyErrorcopyOf(JPropertyParseMonadType.JPropertyErrorType instance)Creates an immutable copy of aJPropertyParseMonadType.JPropertyErrorTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofJPropertyErrorthat have equal attribute values.inthashCode()Computes a hash code from attributes:message.java.lang.Stringmessage()static JPropertyErrorof(java.lang.String message)Construct a new immutableJPropertyErrorinstance.java.lang.StringtoString()Prints the immutable valueJPropertyErrorwith attribute values.JPropertyErrorwithMessage(java.lang.String value)Copy the current immutable object by setting a value for themessageattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Method Details
-
message
public java.lang.String message()- Specified by:
messagein interfaceJPropertyParseMonadType.JPropertyErrorType- Returns:
- The error message
-
withMessage
Copy the current immutable object by setting a value for themessageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for message- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofJPropertyErrorthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:message.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueJPropertyErrorwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableJPropertyErrorinstance.- Parameters:
message- The value for themessageattribute- Returns:
- An immutable JPropertyError instance
-
copyOf
Creates an immutable copy of aJPropertyParseMonadType.JPropertyErrorTypevalue. 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 JPropertyError instance
-
builder
Creates a builder forJPropertyError.JPropertyError.builder() .setMessage(String) // requiredmessage.build();- Returns:
- A new JPropertyError builder
-