Skip to content

Instantly share code, notes, and snippets.

@yohanes
Last active August 20, 2016 23:49
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 yohanes/5909b24a86db0023cd4d614a1fae12de to your computer and use it in GitHub Desktop.
Save yohanes/5909b24a86db0023cd4d614a1fae12de to your computer and use it in GitHub Desktop.
package es.yohan.examples;
class LicenseChecker {
int rootResult;
void checkRoot(String xml_config) {
//do some checking
rootResult = 0;
//setup other things
}
private boolean isValidLicense(String serialnumber) {
result = false;
//computations here
return result;
}
public void validateLicense() throws LicenseException {
String serialnumber = Config.get("SERIAL");
if (!isValidLicense(serialnumber)) {
throw new LicenseException("Invalid serial number");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment