public final class ImmutableTypeCheckPredicate<T> extends TypeCheckPredicate<T>
TypeCheckPredicate.
Use the builder to create immutable instances:
ImmutableTypeCheckPredicate.builder().
Use the static factory method to create immutable instances:
ImmutableTypeCheckPredicate.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableTypeCheckPredicate.Builder<T>
Builds instances of type
ImmutableTypeCheckPredicate. |
| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableTypeCheckPredicate.Builder<T> |
builder()
Creates a builder for
ImmutableTypeCheckPredicate. |
protected Predicate<T> |
check() |
static <T> ImmutableTypeCheckPredicate<T> |
copyOf(TypeCheckPredicate<T> instance)
Creates an immutable copy of a
TypeCheckPredicate value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableTypeCheckPredicate that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
typeClass, check. |
static <T> ImmutableTypeCheckPredicate<T> |
of(Class<T> typeClass,
Predicate<T> check)
Construct a new immutable
TypeCheckPredicate instance. |
String |
toString()
Prints the immutable value
TypeCheckPredicate with attribute values. |
protected Class<T> |
typeClass() |
ImmutableTypeCheckPredicate<T> |
withCheck(Predicate<T> value)
Copy the current immutable object by setting a value for the
check attribute. |
ImmutableTypeCheckPredicate<T> |
withTypeClass(Class<T> value)
Copy the current immutable object by setting a value for the
typeClass attribute. |
isInstanceOf, testprotected Class<T> typeClass()
typeClass in class TypeCheckPredicate<T>typeClass attributeprotected Predicate<T> check()
check in class TypeCheckPredicate<T>check attributepublic final ImmutableTypeCheckPredicate<T> withTypeClass(Class<T> value)
typeClass attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for typeClassthis objectpublic final ImmutableTypeCheckPredicate<T> withCheck(Predicate<T> value)
check attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for checkthis objectpublic boolean equals(Object another)
ImmutableTypeCheckPredicate that have equal attribute values.public int hashCode()
typeClass, check.public String toString()
TypeCheckPredicate with attribute values.public static <T> ImmutableTypeCheckPredicate<T> of(Class<T> typeClass, Predicate<T> check)
TypeCheckPredicate instance.T - generic parameter TtypeClass - The value for the typeClass attributecheck - The value for the check attributepublic static <T> ImmutableTypeCheckPredicate<T> copyOf(TypeCheckPredicate<T> instance)
TypeCheckPredicate value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.T - generic parameter Tinstance - The instance to copypublic static <T> ImmutableTypeCheckPredicate.Builder<T> builder()
ImmutableTypeCheckPredicate.
ImmutableTypeCheckPredicate.<T>builder()
.typeClass(Class<T>) // required typeClass
.check(function.Predicate<T>) // required check
.build();
T - generic parameter TCopyright © 2022. All rights reserved.