public final class ImmutableMappedTextFile<T> extends Object implements MappedTextFile<T>
MappedTextFile.
Use the builder to create immutable instances:
ImmutableMappedTextFile.builder().
Use the static factory method to create immutable instances:
ImmutableMappedTextFile.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableMappedTextFile.Builder<T>
Builds instances of type
ImmutableMappedTextFile. |
| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableMappedTextFile.Builder<T> |
builder()
Creates a builder for
ImmutableMappedTextFile. |
Charset |
charset() |
Function<String,T> |
converter() |
static <T> ImmutableMappedTextFile<T> |
copyOf(MappedTextFile<T> instance)
Creates an immutable copy of a
MappedTextFile value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableMappedTextFile that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
name, converter, charset. |
String |
name() |
static <T> ImmutableMappedTextFile<T> |
of(String name,
Function<String,T> converter)
Construct a new immutable
MappedTextFile instance. |
String |
toString()
Prints the immutable value
MappedTextFile with attribute values. |
ImmutableMappedTextFile<T> |
withCharset(Charset value)
Copy the current immutable object by setting a value for the
charset attribute. |
ImmutableMappedTextFile<T> |
withConverter(Function<String,T> value)
Copy the current immutable object by setting a value for the
converter attribute. |
ImmutableMappedTextFile<T> |
withName(String value)
Copy the current immutable object by setting a value for the
name attribute. |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitanypublic String name()
name in interface MappedTextFile<T>name attributepublic Function<String,T> converter()
converter in interface MappedTextFile<T>converter attributepublic Charset charset()
charset in interface MappedTextFile<T>charset attributepublic final ImmutableMappedTextFile<T> withName(String value)
name attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for namethis objectpublic final ImmutableMappedTextFile<T> withConverter(Function<String,T> value)
converter attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for converterthis objectpublic final ImmutableMappedTextFile<T> withCharset(Charset value)
charset attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for charsetthis objectpublic boolean equals(Object another)
ImmutableMappedTextFile that have equal attribute values.public int hashCode()
name, converter, charset.public String toString()
MappedTextFile with attribute values.public static <T> ImmutableMappedTextFile<T> of(String name, Function<String,T> converter)
MappedTextFile instance.T - generic parameter Tname - The value for the name attributeconverter - The value for the converter attributepublic static <T> ImmutableMappedTextFile<T> copyOf(MappedTextFile<T> instance)
MappedTextFile 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> ImmutableMappedTextFile.Builder<T> builder()
ImmutableMappedTextFile.
ImmutableMappedTextFile.<T>builder()
.name(String) // required name
.converter(function.Function<String, T>) // required converter
.charset(java.nio.charset.Charset) // optional charset
.build();
T - generic parameter TCopyright © 2021. All rights reserved.