io.cloudslang.lang.entities.WorkerGroupStatement Maven / Gradle / Ivy
/*******************************************************************************
* (c) Copyright 2016 Hewlett-Packard Development Company, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
*******************************************************************************/
package io.cloudslang.lang.entities;
import io.cloudslang.lang.entities.bindings.ScriptFunction;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.io.Serializable;
import java.util.Set;
public class WorkerGroupStatement implements Serializable {
private static final long serialVersionUID = -4811273001193667018L;
private final String expression;
private final boolean override;
private final Set functionDependencies;
private final Set systemPropertyDependencies;
public WorkerGroupStatement(String expression,
boolean override,
Set functionDependencies,
Set systemPropertyDependencies) {
Validate.notBlank(expression, "worker group expression cannot be empty");
this.expression = expression;
this.override = override;
this.functionDependencies = functionDependencies;
this.systemPropertyDependencies = systemPropertyDependencies;
}
protected WorkerGroupStatement() {
expression = null;
override = false;
functionDependencies = null;
systemPropertyDependencies = null;
}
public String getExpression() {
return expression;
}
public boolean isOverride() {
return override;
}
public Set getFunctionDependencies() {
return functionDependencies;
}
public Set getSystemPropertyDependencies() {
return systemPropertyDependencies;
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("expression", expression)
.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WorkerGroupStatement that = (WorkerGroupStatement) o;
return new EqualsBuilder()
.append(expression, that.expression)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(expression)
.toHashCode();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy