@Override public int hashCode() { int result = name.hashCode(); result = 31 * result + script.hashCode(); result = 31 * result + language.hashCode(); result = 31 * result + (bindings != null ? bindings.hashCode() : 0); return result; }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ScriptObject)) { return false; } final ScriptObject that = (ScriptObject) o; return !(bindings != null ? !bindings.equals(that.getBindings()) : that.getBindings() != null) && language.equals(that.getLanguage()) && name.equals(that.getName()) && script.equals(that.getScript()); }
/** * Validate this script for the particular language rules and produces a list of {@link * ScriptError} instances if any validation errors occurred. * * @return a list of validation errors if validation failed and an empty list if validation * passed. * @throws java.lang.NullPointerException if script is empty. */ public List<ScriptError> validate() { return language.getScriptValidator().validateScript(this); }