new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override new LazyValue<byte[]>( new BuildValueCommand<byte[]>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override
/** * Returns a string representation of the object. This method calls {@link #buildString * buildString()} and caches the return value when it is called for the first time, and then, * this method returns the cached value from the second time. */ @Override public String toString() { return stringCache.getValue(); }
/** * Returns a string representation of the object. This method calls {@link #buildString * buildString()} and caches the return value when it is called for the first time, and then, this * method returns the cached value from the second time. */ @Override public String toString() { return stringCache.getValue(); }
new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override new LazyValue<byte[]>( new BuildValueCommand<byte[]>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override
/** * Returns a hash code value for the object. This method calls {@link #calcHashCode * calcHashCode()} and caches the return value when it is called for the first time, and then, * this method returns the cached value from the second time. */ @Override public int hashCode() { return hashCodeCache.getValue(); } }
new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override new LazyValue<byte[]>( new BuildValueCommand<byte[]>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override
/** * Returns the hex string representation of this object. This method calls {@link #buildHexString * buildHexString()} and caches the return value when it is called for the first time, and then, * this method returns the cached value from the second time. * * @return a hex string representation of this object */ public String toHexString() { return hexStringCache.getValue(); }
new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override new LazyValue<byte[]>( new BuildValueCommand<byte[]>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<String>( new BuildValueCommand<String>() { @Override new LazyValue<Integer>( new BuildValueCommand<Integer>() { @Override
/** * Returns the header length in bytes. This method calls {@link #calcLength calcLength()} and * caches the return value when it is called for the first time, and then, this method returns * the cached value from the second time. */ @Override public int length() { return lengthCache.getValue(); }
/** * Returns the hex string representation of this object. This method calls {@link * #buildHexString buildHexString()} and caches the return value when it is called for the first * time, and then, this method returns the cached value from the second time. * * @return a hex string representation of this object */ public String toHexString() { return hexStringCache.getValue(); }
/** * Returns the packet length in bytes. This method calls {@link #calcLength calcLength()} and * caches the return value when it is called for the first time, and then, this method returns the * cached value from the second time. */ @Override public int length() { return lengthCache.getValue(); }
/** * Returns a hash code value for the object. This method calls {@link #calcHashCode * calcHashCode()} and caches the return value when it is called for the first time, and then, * this method returns the cached value from the second time. */ @Override public int hashCode() { return hashCodeCache.getValue(); }
/** * Returns this packet's raw data. This method calls {@link #buildRawData buildRawData()} and * caches the return value when it is called for the first time, and then, this method returns the * cached value from the second time. More correctly, this method returns a copy of the cached * value, so that the cache can't be changed. */ @Override public byte[] getRawData() { byte[] rawData = rawDataCache.getValue(); byte[] copy = new byte[rawData.length]; System.arraycopy(rawData, 0, copy, 0, copy.length); return copy; }
/** * Returns this header's raw data. This method calls {@link #buildRawData buildRawData()} and * caches the return value when it is called for the first time, and then, this method returns * the cached value from the second time. More correctly, this method returns a copy of the * cached value, so that the cache can't be changed. */ @Override public byte[] getRawData() { byte[] rawData = rawDataCache.getValue(); byte[] copy = new byte[rawData.length]; System.arraycopy(rawData, 0, copy, 0, copy.length); return copy; }
private void writeObject(ObjectOutputStream out) throws IOException { getValue(); if (value == null) { throw new AssertionError(); } out.defaultWriteObject(); }
/** * Returns the hex string representation of this object. This method calls {@link * #buildHexString buildHexString()} and caches the return value when it is called for the first * time, and then, this method returns the cached value from the second time. * * @return a hex string representation of this object */ public String toHexString() { return hexStringCache.getValue(); }
/** * Returns the packet length in bytes. This method calls {@link #calcLength calcLength()} and * caches the return value when it is called for the first time, and then, this method returns the * cached value from the second time. */ @Override public int length() { return lengthCache.getValue(); }
/** * Returns the header length in bytes. This method calls {@link #calcLength calcLength()} and * caches the return value when it is called for the first time, and then, this method returns * the cached value from the second time. */ @Override public int length() { return lengthCache.getValue(); }
/** * Returns the hex string representation of this object. This method calls {@link #buildHexString * buildHexString()} and caches the return value when it is called for the first time, and then, * this method returns the cached value from the second time. * * @return a hex string representation of this object */ public String toHexString() { return hexStringCache.getValue(); }
/** * Returns a hash code value for the object. This method calls {@link #calcHashCode * calcHashCode()} and caches the return value when it is called for the first time, and then, * this method returns the cached value from the second time. */ @Override public int hashCode() { return hashCodeCache.getValue(); } }