@ParametersAreNonnullByDefault @Generated(value={"Immutables.generator","HeaderIF"}) @Immutable public final class Header extends Object implements HeaderIF
HeaderIF.
Use the builder to create immutable instances:
Header.builder().
Use the static factory method to create immutable instances:
Header.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
Header.Builder
Builds instances of type
Header. |
| Modifier and Type | Method and Description |
|---|---|
static Header.Builder |
builder()
Creates a builder for
Header. |
static Header |
copyOf(HeaderIF instance)
Creates an immutable copy of a
HeaderIF value. |
boolean |
equals(Object another)
This instance is equal to all instances of
Header that have equal attribute values. |
Optional<String> |
getBlockId() |
Text |
getText() |
String |
getType() |
int |
hashCode()
Computes a hash code from attributes:
type, text, blockId. |
static Header |
of(Text text)
Construct a new immutable
Header instance. |
String |
toString()
Prints the immutable value
Header with attribute values. |
Header |
withBlockId(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
blockId attribute. |
Header |
withBlockId(String value)
Copy the current immutable object by setting a present value for the optional
blockId attribute. |
Header |
withText(Text text)
Copy the current immutable object by setting a value for the
text attribute. |
public String getType()
public Text getText()
public Optional<String> getBlockId()
getBlockId in interface BlockblockId attributepublic final Header withText(Text text)
text attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.text - A new value for textthis objectpublic final Header withBlockId(@Nullable String value)
blockId attribute.value - The value for blockId, null is accepted as java.util.Optional.empty()this objectpublic final Header withBlockId(Optional<String> optional)
blockId attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for blockIdthis objectpublic boolean equals(@Nullable Object another)
Header that have equal attribute values.public int hashCode()
type, text, blockId.public String toString()
Header with attribute values.public static Header of(Text text)
Header instance.text - The value for the text attributepublic static Header copyOf(HeaderIF instance)
HeaderIF 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 Header.Builder builder()
Header.Copyright © 2020. All rights reserved.