|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fudgemsg.FudgeMsgBase
org.fudgemsg.ImmutableFudgeMsg
public class ImmutableFudgeMsg
An immutable message in the Fudge system.
The message consists of a list of Fudge fields
.
This class holds the entire message in memory.
Applications are recommended to store and manipulate a ImmutableFudgeFieldContainer
instance rather than this class for future flexibility.
This class can be created as a copy of an existing FudgeFieldContainer
.
For efficiency, the reference to a FudgeContext
is kept and the context is not copied.
In that scenario, changes made to the context will be made visible through this class, for
example the behavior of FudgeMsgBase.getFieldValue(java.lang.Class
. If this is not desired, create a
ImmutableFudgeContext
from your underlying FudgeContext
for use in cloning messages.
Message fields are copied at one level deep only.
Any sub-messages, or referenced objects may be still be mutable.
This class is intended to be immutable but not all contents will necessarily be immutable.
Constructor Summary | |
---|---|
protected |
ImmutableFudgeMsg(FudgeContext fudgeContext)
Creates an immutable empty message. |
|
ImmutableFudgeMsg(FudgeFieldContainer fields,
FudgeContext fudgeContext)
Creates a new ImmutableFudgeMsg by copying fields from another FudgeFieldContainer using
the specified FudgeContext for type resolution. |
|
ImmutableFudgeMsg(FudgeMsgBase fudgeMsg)
Creates a new instance by copying another message. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Checks if this message equals another. |
Methods inherited from class org.fudgemsg.FudgeMsgBase |
---|
fieldNameEquals, fieldOrdinalEquals, getAllByName, getAllByOrdinal, getAllFieldNames, getAllFields, getBoolean, getBoolean, getByIndex, getByName, getByOrdinal, getByte, getByte, getDouble, getDouble, getFields, getFieldValue, getFirstTypedValue, getFirstTypedValue, getFloat, getFloat, getFudgeContext, getInt, getInt, getLong, getLong, getMessage, getMessage, getNumFields, getShort, getShort, getString, getString, getValue, getValue, getValue, getValue, hasField, hasField, hashCode, isEmpty, iterator, setNamesFromTaxonomy, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.fudgemsg.FudgeFieldContainer |
---|
getAllByName, getAllByOrdinal, getAllFieldNames, getAllFields, getBoolean, getBoolean, getByIndex, getByName, getByOrdinal, getByte, getByte, getDouble, getDouble, getFieldValue, getFloat, getFloat, getInt, getInt, getLong, getLong, getMessage, getMessage, getNumFields, getShort, getShort, getString, getString, getValue, getValue, getValue, getValue, hasField, hasField, isEmpty, iterator |
Constructor Detail |
---|
public ImmutableFudgeMsg(FudgeMsgBase fudgeMsg)
The new instance will share the same Fudge context which may be undesirable as that context may be mutable.
fudgeMsg
- the message to copy, not nullpublic ImmutableFudgeMsg(FudgeFieldContainer fields, FudgeContext fudgeContext)
ImmutableFudgeMsg
by copying fields from another FudgeFieldContainer
using
the specified FudgeContext
for type resolution.
fields
- the message to copy, not nullfudgeContext
- the context to use for the new message, not nullprotected ImmutableFudgeMsg(FudgeContext fudgeContext)
fudgeContext
- the context, not nullMethod Detail |
---|
public boolean equals(Object obj)
The check is performed on the entire list of fields in the message.
equals
in class FudgeMsgBase
obj
- the object to compare to, null returns false
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |