com.perforce.p4java.impl.mapbased.rpc.packet
Enum RpcPacketFieldType

java.lang.Object
  extended by java.lang.Enum<RpcPacketFieldType>
      extended by com.perforce.p4java.impl.mapbased.rpc.packet.RpcPacketFieldType
All Implemented Interfaces:
Serializable, Comparable<RpcPacketFieldType>

public enum RpcPacketFieldType
extends Enum<RpcPacketFieldType>

Defines the various Perforce RPC packet field types and associated methods. Mainly used to determine whether to treat a packet field value as a string or bytes; most fields are strings, but things like worKRec or depotRec fields are binary pass-throughs from the point of view of the client (they're state keys and / or state records used by the server).


Enum Constant Summary
BINARY
          Field is bytes, not interpreted.
NONE
          Field type is unknown.
TEXT
          Field is text; possibly UTF-8 encoded.
 
Method Summary
static RpcPacketFieldType getFieldType(String fieldName)
          Return the field type associated with the passed-in name, if any.
static RpcPacketFieldType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static RpcPacketFieldType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final RpcPacketFieldType NONE
Field type is unknown. Field should probably not be used.


TEXT

public static final RpcPacketFieldType TEXT
Field is text; possibly UTF-8 encoded.


BINARY

public static final RpcPacketFieldType BINARY
Field is bytes, not interpreted.

Method Detail

values

public static RpcPacketFieldType[] 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 (RpcPacketFieldType c : RpcPacketFieldType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RpcPacketFieldType 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 name
NullPointerException - if the argument is null

getFieldType

public static RpcPacketFieldType getFieldType(String fieldName)
Return the field type associated with the passed-in name, if any.



Copyright © 2015 Perforce Software. All Rights Reserved.