Class Condition

java.lang.Object
dev.doglog.Condition

@Immutable public final class Condition extends Object
A formula that's true or false, which DogLog Studio calculates a boolean computed entry with. Log one with DogLog.computed(String, Condition).

Make one by comparing formulas, ex. Formula.entry("Arm/Error").lessThan(Inches.of(2)), or from a logged boolean with entry(String), then combine them with and(Condition), or(Condition), and not().

toString() returns the formula's text in the @team581/log-formula language.

  • Method Details

    • entry

      public static Condition entry(String key)
      A logged boolean entry's value.
      Parameters:
      key - The entry's key, ex. "Intake/HasPiece".
    • entryEquals

      public static Condition entryEquals(String key, Enum<?> value)
      Whether a logged enum entry's value is value, ex. entryEquals("Shooter/State", ShooterState.SCORE).
      Parameters:
      key - The entry's key, ex. "Shooter/State".
    • entryEquals

      public static Condition entryEquals(String key, String value)
      Whether a logged string entry's value is exactly value, ex. a state machine's state.
      Parameters:
      key - The entry's key, ex. "Shooter/State".
    • and

      public Condition and(Condition other)
      Whether this and other are both true.
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isEqualTo

      public Condition isEqualTo(Condition other)
      Whether this is the same as other, both true or both false.
    • isNotEqualTo

      public Condition isNotEqualTo(Condition other)
      Whether this is different from other, exactly one of them true.
    • not

      public Condition not()
      Whether this is false.
    • or

      public Condition or(Condition other)
      Whether this or other is true.
    • toString

      public String toString()
      The formula's text, ex. `/Arm/Error` < 2[in].
      Overrides:
      toString in class Object