Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Created June 12, 2022 15:03
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/b2bcf5d8e549d2b0b7c8da35477e7b50 to your computer and use it in GitHub Desktop.
Save le0nidas/b2bcf5d8e549d2b0b7c8da35477e7b50 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) + "/" + VERSION_PREFIX + this.version;
}
public boolean isValid() {
if (getAgent().length() == 0) return false;
if (getVersion().length() == 0) return false;
return getHeader().length() != 0;
}
public String getAgent() {
return agent;
}
public String getHeader() {
return header;
}
public String getVersion() {
return version;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment