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

com.undefinedlabs.scope.settings.remote.ScopeRemoteSettings Maven / Gradle / Ivy

package com.undefinedlabs.scope.settings.remote;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.undefinedlabs.scope.logger.ScopeLogger;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

public class ScopeRemoteSettings {

  public static final ScopeRemoteSettings EMPTY =
      new ScopeRemoteSettings(Collections.emptyList());

  private final List cached;

  @JsonCreator
  public ScopeRemoteSettings(@JsonProperty("cached") final List cached) {
    this.cached = cached;
  }

  @JsonGetter
  public List getCachedTests() {
    return cached;
  }

  @Override
  public boolean equals(final Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    final ScopeRemoteSettings that = (ScopeRemoteSettings) o;
    return Objects.equals(cached, that.cached);
  }

  @Override
  public int hashCode() {
    return Objects.hash(cached);
  }

  @Override
  public String toString() {
    final StringBuilder sb = new StringBuilder("ScopeRemoteSettings{");
    sb.append("cached=").append(cached);
    sb.append('}');
    return sb.toString();
  }

  public void printSettings(final ScopeLogger logger) {
    logger.info("--- CACHED TESTS: " + getCachedTests().size());
    logger.debug("------ " + getCachedTests());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy