All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.undefinedlabs.scope.settings.credentials.ScopeCredentials Maven / Gradle / Ivy

package com.undefinedlabs.scope.settings.credentials;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

public class ScopeCredentials {

  public static final ScopeCredentials EMPTY = new ScopeCredentials("", "");

  private final String apiEndpoint;
  private final String apiKey;

  public ScopeCredentials(final String apiEndpoint, final String apiKey) {
    this.apiEndpoint = apiEndpoint;
    this.apiKey = apiKey;
  }

  public String getApiEndpoint() {
    return apiEndpoint;
  }

  public String getApiKey() {
    return apiKey;
  }

  @Override
  public boolean equals(final Object o) {
    if (this == o) {
      return true;
    }

    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    final ScopeCredentials that = (ScopeCredentials) o;

    return new EqualsBuilder()
        .append(apiEndpoint, that.apiEndpoint)
        .append(apiKey, that.apiKey)
        .isEquals();
  }

  @Override
  public int hashCode() {
    return new HashCodeBuilder(17, 37).append(apiEndpoint).append(apiKey).toHashCode();
  }

  @Override
  public String toString() {
    return new ToStringBuilder(this)
        .append("apiEndpoint", apiEndpoint)
        .append("apiKey", apiKey)
        .toString();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy