org.scassandra.http.client.MultiPrimeRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Allows Java applications to use Scassandra
/*
* Copyright (C) 2014 Christopher Batey
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.scassandra.http.client;
import org.scassandra.cql.CqlType;
import java.util.*;
public final class MultiPrimeRequest {
public static MultiPrimeRequestBuilder request() {
return new MultiPrimeRequestBuilder();
}
public static Then.Builder then() { return new Then.Builder(); }
public static When.Builder when() { return new When.Builder(); }
public static Criteria.Builder match() { return new Criteria.Builder(); }
public static Action.Builder action() { return new Action.Builder(); }
public static Outcome outcome(Criteria.Builder match, Action.Builder action) {
return new Outcome(match.build(), action.build());
}
public static ExactMatch.Builder exactMatch() { return new ExactMatch.Builder(); }
public static VariableMatch exactMatch(Object o) { return new ExactMatch.Builder().withMatcher(o).build(); }
public static VariableMatch anyMatch() { return new AnyMatch(); }
private final When when;
private final Then then;
private MultiPrimeRequest(When when, Then then) {
this.when = when;
this.then = then;
}
public When getWhen() {
return when;
}
public Then getThen() {
return then;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MultiPrimeRequest that = (MultiPrimeRequest) o;
if (when != null ? !when.equals(that.when) : that.when != null) return false;
return then != null ? then.equals(that.then) : that.then == null;
}
@Override
public int hashCode() {
int result = when != null ? when.hashCode() : 0;
result = 31 * result + (then != null ? then.hashCode() : 0);
return result;
}
public final static class Action {
private final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy