Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Created June 12, 2022 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save le0nidas/0669c5c92fa3cc4e91b430d1c28d88fc to your computer and use it in GitHub Desktop.
Save le0nidas/0669c5c92fa3cc4e91b430d1c28d88fc to your computer and use it in GitHub Desktop.
public final class Configuration {
private final String agent;
private final String header;
private final String version;
public Configuration(final Storage storage) {
this.agent = storage.get(KEY_AGENT);
this.version = storage.get(KEY_VERSION);
this.header = storage.get(KEY_HEADER);
}
public boolean isValid() {
if (agent.length() == 0) return false;
if (version.length() == 0) return false;
return header.length() != 0;
}
public String getAgent() {
return agent;
}
public String getHeader() {
return header + "/" + VERSION_PREFIX + this.version;
}
public String getVersion() {
return version;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment