Enum InetAddressMarshaller
- java.lang.Object
-
- java.lang.Enum<InetAddressMarshaller>
-
- org.wildfly.clustering.marshalling.protostream.net.InetAddressMarshaller
-
- All Implemented Interfaces:
Serializable,Comparable<InetAddressMarshaller>,FieldSetMarshaller<InetAddress,InetAddress>,org.wildfly.common.function.ExceptionFunction<String,InetAddress,Exception>,org.wildfly.security.ParametricPrivilegedExceptionAction<InetAddress,String>
public enum InetAddressMarshaller extends Enum<InetAddressMarshaller> implements FieldSetMarshaller<InetAddress,InetAddress>, org.wildfly.security.ParametricPrivilegedExceptionAction<InetAddress,String>
Marshaller for anInetAddress.- Author:
- Paul Ferraro
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InetAddressgetBuilder()Returns a builder for use withFieldSetMarshaller.readField(ProtoStreamReader, int, Object).intgetFields()Returns the number of fields written by this marshaller.InetAddressreadField(ProtoStreamReader reader, int index, InetAddress address)Reads a single field from the specified reader at the specified index.InetAddressrun(String host)static InetAddressMarshallervalueOf(String name)Returns the enum constant of this type with the specified name.static InetAddressMarshaller[]values()Returns an array containing the constants of this enum type, in the order they are declared.voidwriteFields(ProtoStreamWriter writer, int startIndex, InetAddress address)Writes the set of fields from the specified object to the specified writer beginning at the specified index.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
-
-
-
Enum Constant Detail
-
INSTANCE
public static final InetAddressMarshaller INSTANCE
-
-
Method Detail
-
values
public static InetAddressMarshaller[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (InetAddressMarshaller c : InetAddressMarshaller.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static InetAddressMarshaller valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getBuilder
public InetAddress getBuilder()
Description copied from interface:FieldSetMarshallerReturns a builder for use withFieldSetMarshaller.readField(ProtoStreamReader, int, Object). May return a shared instance, if the builder type is immutable, or a new instance, if the builder is mutable.- Specified by:
getBuilderin interfaceFieldSetMarshaller<InetAddress,InetAddress>- Returns:
- a builder.
-
getFields
public int getFields()
Description copied from interface:FieldSetMarshallerReturns the number of fields written by this marshaller.- Specified by:
getFieldsin interfaceFieldSetMarshaller<InetAddress,InetAddress>- Returns:
- a positive number
-
readField
public InetAddress readField(ProtoStreamReader reader, int index, InetAddress address) throws IOException
Description copied from interface:FieldSetMarshallerReads a single field from the specified reader at the specified index.- Specified by:
readFieldin interfaceFieldSetMarshaller<InetAddress,InetAddress>- Parameters:
reader- a ProtoStream readerindex- the field indexaddress- the builder to be populated with the read field- Returns:
- the builder containing the read field
- Throws:
IOException- if the field could not be read
-
writeFields
public void writeFields(ProtoStreamWriter writer, int startIndex, InetAddress address) throws IOException
Description copied from interface:FieldSetMarshallerWrites the set of fields from the specified object to the specified writer beginning at the specified index.- Specified by:
writeFieldsin interfaceFieldSetMarshaller<InetAddress,InetAddress>- Parameters:
writer- a ProtoStream writerstartIndex- the start index for the embedded fieldsaddress- the value to be written- Throws:
IOException- if the value could not be written
-
run
public InetAddress run(String host) throws UnknownHostException
- Specified by:
runin interfaceorg.wildfly.security.ParametricPrivilegedExceptionAction<InetAddress,String>- Throws:
UnknownHostException
-
-