Android Open Source - android-simple-storage Immutable Pair






From Project

Back to project page android-simple-storage.

License

The source code is released under:

Apache License

If you think the Android project android-simple-storage listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.sromku.simple.storage.helpers;
//from w  ww. j a  va2  s. c  om
import java.io.Serializable;

/**
 * @param <T>
 * @param <S>
 */
public class ImmutablePair<T, S> implements Serializable {
  private static final long serialVersionUID = 40;

  public final T element1;
  public final S element2;

  public ImmutablePair() {
    element1 = null;
    element2 = null;
  }

  public ImmutablePair(T element1, S element2) {
    this.element1 = element1;
    this.element2 = element2;
  }

  @Override
  public boolean equals(Object object) {
    if (object instanceof ImmutablePair == false) {
      return false;
    }

    Object object1 = ((ImmutablePair<?, ?>) object).element1;
    Object object2 = ((ImmutablePair<?, ?>) object).element2;

    return element1.equals(object1) && element2.equals(object2);
  }

  @Override
  public int hashCode() {
    return element1.hashCode() << 16 + element2.hashCode();
  }
}




Java Source Code List

com.sromku.simple.storage.AbstractDiskStorage.java
com.sromku.simple.storage.ExternalStorage.java
com.sromku.simple.storage.InternalStorage.java
com.sromku.simple.storage.SimpleStorageConfiguration.java
com.sromku.simple.storage.SimpleStorage.java
com.sromku.simple.storage.Storable.java
com.sromku.simple.storage.StorageException.java
com.sromku.simple.storage.Storage.java
com.sromku.simple.storage.helpers.ImmutablePair.java
com.sromku.simple.storage.helpers.OrderType.java
com.sromku.simple.storage.helpers.SizeUnit.java
com.sromku.simple.storage.security.CipherAlgorithmType.java
com.sromku.simple.storage.security.CipherModeType.java
com.sromku.simple.storage.security.CipherPaddingType.java
com.sromku.simple.storage.security.CipherTransformationType.java
com.sromku.simple.storage.security.SecurityUtil.java