public enum WireType extends Enum<WireType> implements Function<net.openhft.chronicle.bytes.Bytes<?>,Wire>, net.openhft.chronicle.core.LicenceCheck
This enumeration provides utilities to check for the availability of certain wire types such as DeltaWire and DefaultZeroWire. It also provides methods to acquire bytes, useful in serialization operations.
| Enum Constant and Description |
|---|
BINARY
Use this ONLY if intend to use Delta and Binary.
|
BINARY_LIGHT
Use this when only need to use Binary (does not support DeltaWire)
|
COMPRESSED_BINARY |
CSV |
DEFAULT_ZERO_BINARY
Deprecated.
|
DELTA_BINARY
Deprecated.
|
FIELDLESS_BINARY |
JSON |
JSON_ONLY |
RAW |
READ_ANY |
TEXT |
YAML |
YAML_ONLY |
| Modifier and Type | Method and Description |
|---|---|
@Nullable Map<String,Object> |
asMap(@NotNull CharSequence cs)
Converts the provided CharSequence into a Map<String, Object> representation using Wire.
|
String |
asString(Object marshallable)
Converts a given marshallable object to its string representation.
|
<T> T |
fromFile(@NotNull Class<T> expectedType,
String filename)
Deserializes an object of a specified type from a file.
|
<T> T |
fromFile(String filename)
Deserializes an object of generic type from a file.
|
<T> T |
fromString(@NotNull CharSequence cs)
deserializes with an optimistic cast
|
<T> T |
fromString(Class<T> tClass,
@NotNull CharSequence cs)
deserializes as a given class
|
boolean |
isAvailable() |
boolean |
isText()
Indicates if this WireType is of a textual nature.
|
void |
licenceCheck() |
Supplier<net.openhft.chronicle.core.values.BooleanValue> |
newBooleanReference()
Provides a supplier for a new
BooleanValue reference using BinaryBooleanReference. |
Supplier<net.openhft.chronicle.core.values.IntValue> |
newIntReference()
Provides a supplier for a new
IntValue reference using BinaryIntReference. |
Supplier<net.openhft.chronicle.core.values.LongArrayValues> |
newLongArrayReference()
Provides a supplier for a new
LongArrayValues reference using BinaryLongArrayReference. |
Supplier<net.openhft.chronicle.core.values.LongValue> |
newLongReference()
Provides a supplier for a new
LongValue reference using BinaryLongReference. |
Supplier<net.openhft.chronicle.core.values.TwoLongValue> |
newTwoLongReference()
Provides a supplier for a new
TwoLongValue reference using BinaryTwoLongReference. |
<T> @NotNull Stream<T> |
streamFromBytes(@NotNull Class<T> expectedType,
net.openhft.chronicle.bytes.Bytes<?> b)
Streams objects of a specified type from a
Bytes instance. |
<T> @NotNull Stream<T> |
streamFromFile(@NotNull Class<T> expectedType,
String filename)
Streams objects of a specified type from a file.
|
<T> @NotNull Stream<T> |
streamFromFile(String filename)
Streams objects of generic type from a file.
|
void |
toFile(@NotNull String filename,
WriteMarshallable marshallable)
Writes a
WriteMarshallable object to a file. |
<T extends Marshallable> |
toFileAsMap(@NotNull String filename,
@NotNull Map<String,T> map)
Deprecated.
|
<T extends Marshallable> |
toFileAsMap(@NotNull String filename,
@NotNull Map<String,T> map,
boolean compact)
Deprecated.
|
static WireType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static @Nullable WireType |
valueOf(@Nullable Wire wire)
Determines the of a given
Wire instance. |
static WireType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final WireType TEXT
public static final WireType BINARY
BINARY_LIGHTpublic static final WireType BINARY_LIGHT
@Deprecated public static final WireType DEFAULT_ZERO_BINARY
@Deprecated public static final WireType DELTA_BINARY
public static final WireType FIELDLESS_BINARY
public static final WireType COMPRESSED_BINARY
public static final WireType JSON
public static final WireType JSON_ONLY
public static final WireType YAML
public static final WireType YAML_ONLY
public static final WireType RAW
public static final WireType CSV
public static final WireType READ_ANY
public static WireType[] values()
for (WireType c : WireType.values()) System.out.println(c);
public static WireType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null@Nullable public static @Nullable WireType valueOf(@Nullable @Nullable Wire wire)
Wire instance. This method inspects
the underlying type of the provided wire instance and maps it to its corresponding
WireType.wire - The wire instance whose type needs to be determined.IllegalStateException - If the wire type is unrecognized.public Supplier<net.openhft.chronicle.core.values.IntValue> newIntReference()
IntValue reference using BinaryIntReference.public Supplier<net.openhft.chronicle.core.values.BooleanValue> newBooleanReference()
BooleanValue reference using BinaryBooleanReference.public Supplier<net.openhft.chronicle.core.values.LongValue> newLongReference()
LongValue reference using BinaryLongReference.public Supplier<net.openhft.chronicle.core.values.TwoLongValue> newTwoLongReference()
TwoLongValue reference using BinaryTwoLongReference.public Supplier<net.openhft.chronicle.core.values.LongArrayValues> newLongArrayReference()
LongArrayValues reference using BinaryLongArrayReference.public String asString(Object marshallable)
marshallable - The object to be converted to string.@Nullable
public <T> T fromString(@NotNull
@NotNull CharSequence cs)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
T - the type to expectcs - text to deserializeClassCastException - if the object is not a Tnet.openhft.chronicle.core.io.InvalidMarshallableExceptionpublic <T> T fromString(Class<T> tClass, @NotNull @NotNull CharSequence cs) throws net.openhft.chronicle.core.io.InvalidMarshallableException
tClass - to serialize ascs - text to deserializenet.openhft.chronicle.core.io.InvalidMarshallableException@NotNull public <T> T fromFile(String filename) throws IOException, net.openhft.chronicle.core.io.InvalidMarshallableException
T - The type of the object to be deserialized.filename - The path to the file containing the serialized object.IOException - If there's an error reading the file.net.openhft.chronicle.core.io.InvalidMarshallableException - If the object cannot be properly deserialized.@Nullable
public <T> T fromFile(@NotNull
@NotNull Class<T> expectedType,
String filename)
throws IOException,
net.openhft.chronicle.core.io.InvalidMarshallableException
T - The type of the object to be deserialized.expectedType - The expected type of the object to be deserialized.filename - The path to the file containing the serialized object.IOException - If there's an error reading the file.net.openhft.chronicle.core.io.InvalidMarshallableException - If the object cannot be properly deserialized.@NotNull public <T> @NotNull Stream<T> streamFromFile(String filename) throws IOException
T - The type of the objects to be streamed.filename - The path to the file containing the serialized objects.IOException - If there's an error reading the file.@NotNull public <T> @NotNull Stream<T> streamFromFile(@NotNull @NotNull Class<T> expectedType, String filename) throws IOException
T - The type of the objects to be streamed.expectedType - The expected type of the objects to be streamed.filename - The path to the file containing the serialized objects.IOException - If there's an error reading the file.@NotNull public <T> @NotNull Stream<T> streamFromBytes(@NotNull @NotNull Class<T> expectedType, net.openhft.chronicle.bytes.Bytes<?> b)
Bytes instance.T - The type of the objects to be streamed.expectedType - The expected type of the objects to be streamed.b - The Bytes instance containing the serialized objects.@Deprecated public <T extends Marshallable> void toFileAsMap(@NotNull @NotNull String filename, @NotNull @NotNull Map<String,T> map) throws IOException, net.openhft.chronicle.core.io.InvalidMarshallableException
IOExceptionnet.openhft.chronicle.core.io.InvalidMarshallableException@Deprecated public <T extends Marshallable> void toFileAsMap(@NotNull @NotNull String filename, @NotNull @NotNull Map<String,T> map, boolean compact) throws IOException, net.openhft.chronicle.core.io.InvalidMarshallableException
IOExceptionnet.openhft.chronicle.core.io.InvalidMarshallableExceptionpublic void toFile(@NotNull
@NotNull String filename,
WriteMarshallable marshallable)
throws IOException,
net.openhft.chronicle.core.io.InvalidMarshallableException
WriteMarshallable object to a file.filename - The name of the file to write to.marshallable - The object to write.IOException - If there's an error writing to the file.net.openhft.chronicle.core.io.InvalidMarshallableException - If the object cannot be properly serialized.@Nullable public @Nullable Map<String,Object> asMap(@NotNull @NotNull CharSequence cs) throws net.openhft.chronicle.core.io.InvalidMarshallableException
cs - The CharSequence to be converted.net.openhft.chronicle.core.io.InvalidMarshallableException - If the CharSequence cannot be properly deserialized.public void licenceCheck()
licenceCheck in interface net.openhft.chronicle.core.LicenceCheckpublic boolean isAvailable()
isAvailable in interface net.openhft.chronicle.core.LicenceCheckpublic boolean isText()
Copyright © 2024. All rights reserved.