org.apache.solr.client.solrj.cloud.autoscaling

## Class Clause

- java.lang.Object
- - org.apache.solr.client.solrj.cloud.autoscaling.Clause

All Implemented Interfaces:
  Comparable<Clause>, MapSerializable, MapWriter

Direct Known Subclasses:
  SealedClause

    public class Clause
    extends Object
    implements MapWriter, Comparable<Clause>

Represents a set of conditions in the policy

### Nested Class Summary

Nested Classes
`static class` `Clause.ComputedValueEvaluator`

### Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

### Field Summary

Fields
`static String` `METRICS_PREFIX`

### Constructor Summary

Constructors
`protected` `Clause(Clause clause, Function<Condition,Object> computedValueEvaluator)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`int` `compareTo(Clause that)`
`static Clause` `create(Map<String,Object> m)`
`static Clause` `create(String json)`
`boolean` `doesOverride(Clause that)`
`boolean` `equals(Object o)`
`Condition` `getCollection()`
`Condition` `getGlobalTag()`
`Condition` `getReplica()`
`SealedClause` `getSealedClause(Function<Condition,Object> computedValueEvaluator)`
`Condition` `getShard()`
`Condition` `getTag()`
`boolean` `isMatch(ReplicaInfo r, String collection, String shard)`
`boolean` `isPerCollectiontag()`
`boolean` `isStrict()`
`static Double` `parseDouble(String name, Object val)`
`static Long` `parseLong(String name, Object val)`
`static String` `parseString(Object val)`
`List<Violation>` `test(Policy.Session session, double[] deviations)`
`void` `throwExp(Map<String,Object> clause, String msg, Object... args)`
`String` `toString()`
`static Object` `validate(String name, Object val, boolean isRuleVal)`
`void` `writeMap(MapWriter.EntryWriter ew)`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap`

### Field Detail

#### METRICS_PREFIX

    public static final String METRICS_PREFIX

See Also:
  Constant Field Values

### Constructor Detail

#### Clause

    protected Clause(Clause clause,
                     Function<Condition,Object> computedValueEvaluator)

### Method Detail

#### create

    public static Clause create(String json)

#### create

    public static Clause create(Map<String,Object> m)

#### parseString

    public static String parseString(Object val)

#### getCollection

    public Condition getCollection()

#### getShard

    public Condition getShard()

#### getReplica

    public Condition getReplica()

#### getTag

    public Condition getTag()

#### getGlobalTag

    public Condition getGlobalTag()

#### doesOverride

    public boolean doesOverride(Clause that)

#### isPerCollectiontag

    public boolean isPerCollectiontag()

#### compareTo

    public int compareTo(Clause that)

Specified by:
  `compareTo` in interface `Comparable<Clause>`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### getSealedClause

    public SealedClause getSealedClause(Function<Condition,Object> computedValueEvaluator)

#### throwExp

    public void throwExp(Map<String,Object> clause,
                         String msg,
                         Object... args)

#### test

    public List<Violation> test(Policy.Session session,
                                double[] deviations)

#### isMatch

    public boolean isMatch(ReplicaInfo r,
                           String collection,
                           String shard)

#### isStrict

    public boolean isStrict()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### writeMap

    public void writeMap(MapWriter.EntryWriter ew)
                  throws IOException

Specified by:
  `writeMap` in interface `MapWriter`
Throws:
  `IOException`

#### validate

    public static Object validate(String name,
                                  Object val,
                                  boolean isRuleVal)

Parameters:
  `name` - name of the condition
  `val` - value of the condition
  `isRuleVal` - is this provided in the rule
Returns:
  actual validated value

#### parseLong

    public static Long parseLong(String name,
                                 Object val)

#### parseDouble

    public static Double parseDouble(String name,
                                     Object val)