/** * Returns whether the given wrapper type supports unwrapping. * * @param type must not be {@literal null}. * @return */ public static boolean supportsUnwrapping(Class<?> type) { Assert.notNull(type, "Type must not be null!"); for (WrapperType candidate : UNWRAPPER_TYPES) { if (candidate.getType().isAssignableFrom(type)) { return true; } } return false; }
public static boolean isSingleValue(Class<?> type) { for (WrapperType candidate : WRAPPER_TYPES) { if (candidate.getType().isAssignableFrom(type)) { return candidate.isSingleValue(); } } return false; }
/** * Returns whether the given type is a supported wrapper type. * * @param type must not be {@literal null}. * @return */ public static boolean supports(Class<?> type) { Assert.notNull(type, "Type must not be null!"); for (WrapperType candidate : WRAPPER_TYPES) { if (candidate.getType().isAssignableFrom(type)) { return true; } } return false; }
public static WrapperType getWrapperType() { return WrapperType.singleValue(io.vavr.control.Option.class); }
public static WrapperType getWrapperType() { return WrapperType.singleValue(javaslang.control.Option.class); }
public WrapperType getWrapperType() { return WrapperType.multiValue(io.vavr.collection.Traversable.class); }
public WrapperType getWrapperType() { return WrapperType.multiValue(javaslang.collection.Traversable.class); }
public static WrapperType noValue(Class<?> type) { return new WrapperType(type, Cardinality.NONE); }
public static WrapperType multiValue(Class<?> type) { return new WrapperType(type, Cardinality.MULTI); }
public static WrapperType singleValue(Class<?> type) { return new WrapperType(type, Cardinality.SINGLE); }
public static WrapperType getWrapperType() { return WrapperType.singleValue(java.util.Optional.class); } }
public static WrapperType getWrapperType() { return WrapperType.singleValue(CompletableFuture.class); } }
public static WrapperType getWrapperType() { return WrapperType.singleValue(Option.class); } }
public static WrapperType getWrapperType() { return WrapperType.singleValue(Optional.class); } }