org.jmonks.batch.io
Class RecordType

java.lang.Object
  extended byorg.jmonks.batch.io.RecordType

public final class RecordType
extends java.lang.Object

RecordType defines the different kind of records can be available in a file. This defines the constants to identify all the records as enums. This record type information should be provided when defining the record spec in file spec.

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Field Summary
static RecordType BLOCK_END
          Represents the ending record of the block and the value to be used in the record spec is "BLOCK-END".
static RecordType BLOCK_START
          Represents the starting record of the block and the value to be used in the record spec is "BLOCK-START".
static RecordType DETAIL
          Represents the detailed record and the value to be used in the record spec is "DETAIL".
static RecordType HEADER
          Represents the header record and the value to be used in the record spec is "HEADER".
static RecordType TRAILER
          Represents the header record and the value to be used in the record spec is "TRAILER".
 
Method Summary
 boolean equals(java.lang.Object recordType)
          Equality will be based on the type.
 int hashCode()
          Hashcode of the type will be returned as a hash code.
static RecordType toRecordType(java.lang.String recordType)
          Utility method returns the RecordType object matches to the given value.
 java.lang.String toString()
          Returns the string representation of the RecordType which can be used to define the record spec in file spec.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HEADER

public static final RecordType HEADER
Represents the header record and the value to be used in the record spec is "HEADER".


TRAILER

public static final RecordType TRAILER
Represents the header record and the value to be used in the record spec is "TRAILER".


DETAIL

public static final RecordType DETAIL
Represents the detailed record and the value to be used in the record spec is "DETAIL".


BLOCK_START

public static final RecordType BLOCK_START
Represents the starting record of the block and the value to be used in the record spec is "BLOCK-START".


BLOCK_END

public static final RecordType BLOCK_END
Represents the ending record of the block and the value to be used in the record spec is "BLOCK-END".

Method Detail

toRecordType

public static RecordType toRecordType(java.lang.String recordType)
Utility method returns the RecordType object matches to the given value. If it doesnt match with the any pre defined record types, it creates and returns a new record type.

Returns:
Returns the RecordType.
Throws:
java.lang.IllegalArgumentException - Throws if the recordType is null or the value is in use.

equals

public boolean equals(java.lang.Object recordType)
Equality will be based on the type.

See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Hashcode of the type will be returned as a hash code.

See Also:
Object.hashCode()

toString

public final java.lang.String toString()
Returns the string representation of the RecordType which can be used to define the record spec in file spec.