Package hydra.typing
Class Result
- java.lang.Object
-
- hydra.typing.Result
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Result>
public class Result extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Result>
The result of a term, consisting of a type and an optional human-readable description.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResult.BuilderA fluent builder forResult.
-
Field Summary
Fields Modifier and Type Field Description Optional<java.lang.String>descriptionAn optional human-readable description of the resultstatic NameDESCRIPTIONName of thehydra.typing.Result.descriptionfield.TypetypeThe type of the resultstatic NameTYPEName of thehydra.typing.Result.typefield.static NameTYPE_Name of thehydra.typing.Resulttype.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Result.Builderbuilder()Creates a new fluent builder forResult.intcompareTo(Result other)booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()ResultwithDescription(Optional<java.lang.String> description)Returns a copy of thisResultwithdescriptionreplaced.ResultwithType(Type type)Returns a copy of thisResultwithtypereplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.typing.Resulttype.
-
DESCRIPTION
public static final Name DESCRIPTION
Name of thehydra.typing.Result.descriptionfield.
-
TYPE
public static final Name TYPE
Name of thehydra.typing.Result.typefield.
-
description
public final Optional<java.lang.String> description
An optional human-readable description of the result
-
type
public final Type type
The type of the result
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(Result other)
- Specified by:
compareToin interfacejava.lang.Comparable<Result>
-
withDescription
public Result withDescription(Optional<java.lang.String> description)
Returns a copy of thisResultwithdescriptionreplaced.
-
builder
public static Result.Builder builder()
Creates a new fluent builder forResult.
-
-