Class Either<L,R>
- java.lang.Object
-
- org.eclipse.lsp4j.jsonrpc.messages.Either<L,R>
-
- Direct Known Subclasses:
Either3
public class Either<L,R> extends java.lang.ObjectAn either type maps union types in protocol specifications.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static java.util.Collection<java.lang.reflect.Type>collectDisjoinTypes(java.lang.Class<?> type, java.util.Collection<java.lang.reflect.Type> types)Deprecated.protected static java.util.Collection<java.lang.reflect.Type>collectDisjoinTypes(java.lang.reflect.ParameterizedType type, java.util.Collection<java.lang.reflect.Type> types)Deprecated.protected static java.util.Collection<java.lang.reflect.Type>collectDisjoinTypes(java.lang.reflect.Type type, java.util.Collection<java.lang.reflect.Type> types)Deprecated.booleanequals(java.lang.Object obj)static <L,R>
Either<L,R>forLeft(L left)static <L,R>
Either<L,R>forRight(R right)java.lang.Objectget()static java.util.Collection<java.lang.reflect.Type>getAllDisjoinTypes(java.lang.reflect.Type type)Deprecated.UseTypeUtils.getExpectedTypes(Type)insteadLgetLeft()static java.lang.reflect.TypegetLeftDisjointType(java.lang.reflect.Type type)Deprecated.UseTypeUtils.getElementTypes(Type, Class, Class)insteadRgetRight()static java.lang.reflect.TypegetRightDisjointType(java.lang.reflect.Type type)Deprecated.UseTypeUtils.getElementTypes(Type, Class, Class)insteadinthashCode()static booleanisEither(java.lang.Class<?> cls)Deprecated.UseTypeUtils.isEither(Type)insteadstatic booleanisEither(java.lang.reflect.ParameterizedType type)Deprecated.UseTypeUtils.isEither(Type)insteadstatic booleanisEither(java.lang.reflect.Type type)Deprecated.UseTypeUtils.isEither(Type)insteadbooleanisLeft()booleanisRight()<T> Tmap(java.util.function.Function<? super L,? extends T> mapLeft, java.util.function.Function<? super R,? extends T> mapRight)java.lang.StringtoString()
-
-
-
Method Detail
-
forLeft
public static <L,R> Either<L,R> forLeft(L left)
-
forRight
public static <L,R> Either<L,R> forRight(R right)
-
getLeft
public L getLeft()
-
getRight
public R getRight()
-
get
public java.lang.Object get()
-
isLeft
public boolean isLeft()
-
isRight
public boolean isRight()
-
map
public <T> T map(java.util.function.Function<? super L,? extends T> mapLeft, java.util.function.Function<? super R,? extends T> mapRight)
-
equals
public boolean equals(java.lang.Object obj)
- 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
-
getLeftDisjointType
@Deprecated public static java.lang.reflect.Type getLeftDisjointType(java.lang.reflect.Type type)
Deprecated.UseTypeUtils.getElementTypes(Type, Class, Class)insteadReturn a left disjoint type if the given type is either.
-
getRightDisjointType
@Deprecated public static java.lang.reflect.Type getRightDisjointType(java.lang.reflect.Type type)
Deprecated.UseTypeUtils.getElementTypes(Type, Class, Class)insteadReturn a right disjoint type if the given type is either.
-
getAllDisjoinTypes
@Deprecated public static java.util.Collection<java.lang.reflect.Type> getAllDisjoinTypes(java.lang.reflect.Type type)
Deprecated.UseTypeUtils.getExpectedTypes(Type)insteadReturn all disjoint types.
-
collectDisjoinTypes
@Deprecated protected static java.util.Collection<java.lang.reflect.Type> collectDisjoinTypes(java.lang.reflect.Type type, java.util.Collection<java.lang.reflect.Type> types)Deprecated.
-
collectDisjoinTypes
@Deprecated protected static java.util.Collection<java.lang.reflect.Type> collectDisjoinTypes(java.lang.reflect.ParameterizedType type, java.util.Collection<java.lang.reflect.Type> types)Deprecated.
-
collectDisjoinTypes
@Deprecated protected static java.util.Collection<java.lang.reflect.Type> collectDisjoinTypes(java.lang.Class<?> type, java.util.Collection<java.lang.reflect.Type> types)Deprecated.
-
isEither
@Deprecated public static boolean isEither(java.lang.reflect.Type type)
Deprecated.UseTypeUtils.isEither(Type)insteadTest whether the given type is Either.
-
isEither
@Deprecated public static boolean isEither(java.lang.reflect.ParameterizedType type)
Deprecated.UseTypeUtils.isEither(Type)insteadTest whether the given type is Either.
-
isEither
@Deprecated public static boolean isEither(java.lang.Class<?> cls)
Deprecated.UseTypeUtils.isEither(Type)insteadTest whether the given class is Either.
-
-