// Automatically created - do not modify - CSOFF ///CLOVER:OFF package com.opengamma.engine.cache.msg; public class IdentifierLookupResponse extends com.opengamma.engine.cache.msg.CacheMessage implements java.io.Serializable { public CacheMessage accept (CacheMessageVisitor visitor) { return visitor.visitIdentifierLookupResponse (this); } private static final long serialVersionUID = -51269628524l; private java.util.List<Long> _identifier; public static final String IDENTIFIER_KEY = "identifier"; public IdentifierLookupResponse (java.util.Collection<? extends Long> identifier) { if (identifier == null) throw new NullPointerException ("'identifier' cannot be null"); else { final java.util.List<Long> fudge0 = new java.util.ArrayList<Long> (identifier); if (identifier.size () == 0) throw new IllegalArgumentException ("'identifier' cannot be an empty list"); for (java.util.ListIterator<Long> fudge1 = fudge0.listIterator (); fudge1.hasNext (); ) { Long fudge2 = fudge1.next (); if (fudge2 == null) throw new NullPointerException ("List element of 'identifier' cannot be null"); } _identifier = fudge0; } } protected IdentifierLookupResponse (final org.fudgemsg.mapping.FudgeDeserializer deserializer, final org.fudgemsg.FudgeMsg fudgeMsg) { super (deserializer, fudgeMsg); java.util.List<org.fudgemsg.FudgeField> fudgeFields; fudgeFields = fudgeMsg.getAllByName (IDENTIFIER_KEY); if (fudgeFields.size () == 0) throw new IllegalArgumentException ("Fudge message is not a IdentifierLookupResponse - field 'identifier' is not present"); _identifier = new java.util.ArrayList<Long> (fudgeFields.size ()); for (org.fudgemsg.FudgeField fudge1 : fudgeFields) { try { _identifier.add (fudgeMsg.getFieldValue (Long.class, fudge1)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException ("Fudge message is not a IdentifierLookupResponse - field 'identifier' is not long", e); } } } public IdentifierLookupResponse (Long correlationId, java.util.Collection<? extends Long> identifier) { super (correlationId); if (identifier == null) throw new NullPointerException ("'identifier' cannot be null"); else { final java.util.List<Long> fudge0 = new java.util.ArrayList<Long> (identifier); if (identifier.size () == 0) throw new IllegalArgumentException ("'identifier' cannot be an empty list"); for (java.util.ListIterator<Long> fudge1 = fudge0.listIterator (); fudge1.hasNext (); ) { Long fudge2 = fudge1.next (); if (fudge2 == null) throw new NullPointerException ("List element of 'identifier' cannot be null"); } _identifier = fudge0; } } protected IdentifierLookupResponse (final IdentifierLookupResponse source) { super (source); if (source == null) throw new NullPointerException ("'source' must not be null"); if (source._identifier == null) _identifier = null; else { _identifier = new java.util.ArrayList<Long> (source._identifier); } } public IdentifierLookupResponse clone () { return new IdentifierLookupResponse (this); } public org.fudgemsg.FudgeMsg toFudgeMsg (final org.fudgemsg.mapping.FudgeSerializer serializer) { if (serializer == null) throw new NullPointerException ("serializer must not be null"); final org.fudgemsg.MutableFudgeMsg msg = serializer.newMessage (); toFudgeMsg (serializer, msg); return msg; } public void toFudgeMsg (final org.fudgemsg.mapping.FudgeSerializer serializer, final org.fudgemsg.MutableFudgeMsg msg) { super.toFudgeMsg (serializer, msg); if (_identifier != null) { for (Long fudge1 : _identifier) { msg.add (IDENTIFIER_KEY, null, fudge1); } } } public static IdentifierLookupResponse fromFudgeMsg (final org.fudgemsg.mapping.FudgeDeserializer deserializer, final org.fudgemsg.FudgeMsg fudgeMsg) { final java.util.List<org.fudgemsg.FudgeField> types = fudgeMsg.getAllByOrdinal (0); for (org.fudgemsg.FudgeField field : types) { final String className = (String)field.getValue (); if ("com.opengamma.engine.cache.msg.IdentifierLookupResponse".equals (className)) break; try { return (com.opengamma.engine.cache.msg.IdentifierLookupResponse)Class.forName (className).getDeclaredMethod ("fromFudgeMsg", org.fudgemsg.mapping.FudgeDeserializer.class, org.fudgemsg.FudgeMsg.class).invoke (null, deserializer, fudgeMsg); } catch (Throwable t) { // no-action } } return new IdentifierLookupResponse (deserializer, fudgeMsg); } public java.util.List<Long> getIdentifier () { return java.util.Collections.unmodifiableList (_identifier); } public void setIdentifier (Long identifier) { if (identifier == null) throw new NullPointerException ("'identifier' cannot be null"); else { _identifier = new java.util.ArrayList<Long> (1); addIdentifier (identifier); } } public void setIdentifier (java.util.Collection<? extends Long> identifier) { if (identifier == null) throw new NullPointerException ("'identifier' cannot be null"); else { final java.util.List<Long> fudge0 = new java.util.ArrayList<Long> (identifier); if (identifier.size () == 0) throw new IllegalArgumentException ("'identifier' cannot be an empty list"); for (java.util.ListIterator<Long> fudge1 = fudge0.listIterator (); fudge1.hasNext (); ) { Long fudge2 = fudge1.next (); if (fudge2 == null) throw new NullPointerException ("List element of 'identifier' cannot be null"); } _identifier = fudge0; } } public void addIdentifier (Long identifier) { if (identifier == null) throw new NullPointerException ("'identifier' cannot be null"); if (_identifier == null) _identifier = new java.util.ArrayList<Long> (); _identifier.add (identifier); } public String toString () { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this, org.apache.commons.lang.builder.ToStringStyle.SHORT_PREFIX_STYLE); } } ///CLOVER:ON - CSON