Package com.io7m.jproperties.monad
Class JPropertyFailure<A>
java.lang.Object
com.io7m.jproperties.monad.JPropertyFailure<A>
- Type Parameters:
A- The type of result values
- All Implemented Interfaces:
JPropertyParseMonadType<A>,JPropertyParseMonadType.JPropertyFailureType<A>
public final class JPropertyFailure<A>
extends Object
implements JPropertyParseMonadType.JPropertyFailureType<A>
A result indicating failure.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.io7m.jproperties.monad.JPropertyParseMonadType
JPropertyParseMonadType.JPropertyErrorType, JPropertyParseMonadType.JPropertyFailureType<A>, JPropertyParseMonadType.JPropertySuccessType<A>, JPropertyParseMonadType.JPropertyWarningType, JPropertyParseMonadType.Kind, JPropertyParseMonadType.Unit -
Method Summary
Modifier and TypeMethodDescriptionstatic <A> JPropertyFailure.Builder<A>builder()Creates a builder forJPropertyFailure.static <A> JPropertyFailure<A>copyOf(JPropertyParseMonadType.JPropertyFailureType<A> instance) Creates an immutable copy of aJPropertyParseMonadType.JPropertyFailureTypevalue.booleanThis instance is equal to all instances ofJPropertyFailurethat have equal attribute values.errors()inthashCode()Computes a hash code from attributes:exception,warnings,errors.toString()Prints the immutable valueJPropertyFailurewith attribute values.warnings()final JPropertyFailure<A>withErrors(JPropertyError... elements) Copy the current immutable object with elements that replace the content oferrors.final JPropertyFailure<A>withErrors(Iterable<? extends JPropertyError> elements) Copy the current immutable object with elements that replace the content oferrors.final JPropertyFailure<A>withException(Exception value) Copy the current immutable object by setting a value for theexceptionattribute.final JPropertyFailure<A>withWarnings(JPropertyWarning... elements) Copy the current immutable object with elements that replace the content ofwarnings.final JPropertyFailure<A>withWarnings(Iterable<? extends JPropertyWarning> elements) Copy the current immutable object with elements that replace the content ofwarnings.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jproperties.monad.JPropertyParseMonadType
andThenMethods inherited from interface com.io7m.jproperties.monad.JPropertyParseMonadType.JPropertyFailureType
flatMap, kind, map
-
Method Details
-
exception
- Specified by:
exceptionin interfaceJPropertyParseMonadType.JPropertyFailureType<A>- Returns:
- The exception raised during parsing
-
warnings
- Specified by:
warningsin interfaceJPropertyParseMonadType<A>- Returns:
- The accumulated warnings
-
errors
- Specified by:
errorsin interfaceJPropertyParseMonadType<A>- Returns:
- The accumulated errors
-
withException
Copy the current immutable object by setting a value for theexceptionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for exception- Returns:
- A modified copy of the
thisobject
-
withWarnings
Copy the current immutable object with elements that replace the content ofwarnings.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withWarnings
Copy the current immutable object with elements that replace the content ofwarnings. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of warnings elements to set- Returns:
- A modified copy of
thisobject
-
withErrors
Copy the current immutable object with elements that replace the content oferrors.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withErrors
Copy the current immutable object with elements that replace the content oferrors. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of errors elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofJPropertyFailurethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:exception,warnings,errors. -
toString
Prints the immutable valueJPropertyFailurewith attribute values. -
copyOf
public static <A> JPropertyFailure<A> copyOf(JPropertyParseMonadType.JPropertyFailureType<A> instance) Creates an immutable copy of aJPropertyParseMonadType.JPropertyFailureTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
A- generic parameter A- Parameters:
instance- The instance to copy- Returns:
- A copied immutable JPropertyFailure instance
-
builder
Creates a builder forJPropertyFailure.- Type Parameters:
A- generic parameter A- Returns:
- A new JPropertyFailure builder
-