| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableTextFile.Builder
Builds instances of type
ImmutableTextFile. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableTextFile.Builder |
builder()
Creates a builder for
ImmutableTextFile. |
Charset |
charset() |
static ImmutableTextFile |
copyOf(TextFile instance)
Creates an immutable copy of a
TextFile value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableTextFile that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
name, charset. |
String |
name() |
static ImmutableTextFile |
of(String name)
Construct a new immutable
TextFile instance. |
String |
toString()
Prints the immutable value
TextFile with attribute values. |
ImmutableTextFile |
withCharset(Charset value)
Copy the current immutable object by setting a value for the
charset attribute. |
ImmutableTextFile |
withName(String value)
Copy the current immutable object by setting a value for the
name attribute. |
public String name()
public Charset charset()
public final ImmutableTextFile 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 ImmutableTextFile 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)
ImmutableTextFile that have equal attribute values.public int hashCode()
name, charset.public String toString()
TextFile with attribute values.public static ImmutableTextFile of(String name)
TextFile instance.name - The value for the name attributepublic static ImmutableTextFile copyOf(TextFile instance)
TextFile value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableTextFile.Builder builder()
ImmutableTextFile.
ImmutableTextFile.builder()
.name(String) // required name
.charset(java.nio.charset.Charset) // optional charset
.build();
Copyright © 2022. All rights reserved.