Package net.morimekta.providence.util
Class Empty
- java.lang.Object
-
- net.morimekta.providence.util.Empty
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Empty>
,PMessage<Empty,Empty._Field>
,PValue<Empty>
,BinaryWriter
,net.morimekta.util.Stringable
@Generated("providence-maven-plugin") @Immutable public class Empty extends java.lang.Object implements PMessage<Empty,Empty._Field>, java.lang.Comparable<Empty>, java.io.Serializable, BinaryWriter
Dummy struct that is just empty. Can be used to "ignore" everything.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Empty._Builder
Dummy struct that is just empty.static class
Empty._Field
-
Field Summary
Fields Modifier and Type Field Description static PStructDescriptor<Empty,Empty._Field>
kDescriptor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
Pure string representation of content.static Empty._Builder
builder()
Make aputil.Empty
builder.int
compareTo(Empty other)
PStructDescriptor<Empty,Empty._Field>
descriptor()
boolean
equals(java.lang.Object o)
<T> T
get(int key)
boolean
has(int key)
int
hashCode()
Empty._Builder
mutate()
Get a builder that extends the current object.static PStructDescriptorProvider<Empty,Empty._Field>
provider()
java.lang.String
toString()
int
writeBinary(net.morimekta.util.io.BigEndianBinaryWriter writer)
Write the current message to the binary writer.
-
-
-
Field Detail
-
kDescriptor
public static final PStructDescriptor<Empty,Empty._Field> kDescriptor
-
-
Method Detail
-
has
public boolean has(int key)
- Specified by:
has
in interfacePMessage<Empty,Empty._Field>
- Parameters:
key
- The key of the field.- Returns:
- Whether the field is present.
-
get
public <T> T get(int key)
- Specified by:
get
in interfacePMessage<Empty,Empty._Field>
- Type Parameters:
T
- The return type.- Parameters:
key
- The key of the field.- Returns:
- The value of the field.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
asString
@Nonnull public java.lang.String asString()
Description copied from interface:PMessage
Pure string representation of content. Does not contain type info.- Specified by:
asString
in interfacePMessage<Empty,Empty._Field>
- Specified by:
asString
in interfacenet.morimekta.util.Stringable
- Returns:
- String representation.
-
compareTo
public int compareTo(Empty other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Empty>
-
writeBinary
public int writeBinary(net.morimekta.util.io.BigEndianBinaryWriter writer) throws java.io.IOException
Description copied from interface:BinaryWriter
Write the current message to the binary writer. NOTE: This method is not intended to be used directly. Instead use theBinarySerializer.serialize(OutputStream, PMessage)
call.- Specified by:
writeBinary
in interfaceBinaryWriter
- Parameters:
writer
- The binary writer to write to.- Returns:
- The number of bytes written.
- Throws:
java.io.IOException
- If it failed to write the message for any reason.
-
mutate
@Nonnull public Empty._Builder mutate()
Description copied from interface:PMessage
Get a builder that extends the current object.- Specified by:
mutate
in interfacePMessage<Empty,Empty._Field>
- Returns:
- The builder instance.
-
provider
@Nonnull public static PStructDescriptorProvider<Empty,Empty._Field> provider()
-
descriptor
@Nonnull public PStructDescriptor<Empty,Empty._Field> descriptor()
- Specified by:
descriptor
in interfacePMessage<Empty,Empty._Field>
- Specified by:
descriptor
in interfacePValue<Empty>
-
builder
public static Empty._Builder builder()
Make aputil.Empty
builder.- Returns:
- The builder instance.
-
-