Exemplo n.º 1
0
 @Override
 public int hashCode() {
   int result = 0;
   for (final Any<?> value : _value) {
     result += value.hashCode();
   }
   return result;
 }
Exemplo n.º 2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;

    if (obj == null) return false;

    if (!(obj instanceof Any)) return false;

    final Any<?> other = (Any<?>) obj;

    if (type() != other.type()) return false;

    if (size() != other.size()) return false;

    for (int i = 0; i < size(); ++i) {
      if (!item(i).equals(other.item(nameOf(i)))) return false;
    }
    return true;
  }
Exemplo n.º 3
0
 @Override
 public <T> T value(Named<T> name) {
   final Any<T> result = item(name);
   return (null == result) ? null : result.get();
 };