Class Utils

java.lang.Object
io.dialob.session.engine.Utils

public final class Utils extends Object
  • Method Details

    • mapQuestionTypeToValueType

      public static Optional<ValueType> mapQuestionTypeToValueType(String type)
    • isVariable

      public static boolean isVariable(@NonNull String type)
    • isContextVariable

      public static boolean isContextVariable(@NonNull String type)
    • isProgramVariable

      public static boolean isProgramVariable(@NonNull String type)
    • isNote

      public static boolean isNote(@NonNull String type)
    • isRowgroup

      public static boolean isRowgroup(@NonNull String type)
    • isQuestionType

      public static boolean isQuestionType(@NonNull ItemState itemState)
    • parse

      @Nullable public static Object parse(@NonNull String type, Object answer)
    • parse

      @Nullable public static Object parse(@NonNull ValueType valueType, Object value)
    • toValueSet

      @NonNull public static io.dialob.api.proto.ValueSet toValueSet(@NonNull ValueSetState valueSetState)
    • toError

      @NonNull public static io.dialob.api.questionnaire.Error toError(@NonNull ErrorState updated)
    • toActionItem

      @NonNull public static io.dialob.api.proto.ActionItem toActionItem(@NonNull ItemState itemState, UnaryOperator<io.dialob.api.proto.ImmutableActionItem.Builder> post)
    • writeNullableString

      public static void writeNullableString(@NonNull com.google.protobuf.CodedOutputStream output, String string) throws IOException
      Throws:
      IOException
    • readNullableString

      @Nullable public static String readNullableString(@NonNull com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • writeNullableDate

      public static void writeNullableDate(@NonNull com.google.protobuf.CodedOutputStream output, Date date) throws IOException
      Throws:
      IOException
    • readNullableDate

      public static Date readNullableDate(@NonNull com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • writeObjectValue

      public static void writeObjectValue(@NonNull com.google.protobuf.CodedOutputStream output, Object value) throws IOException
      Throws:
      IOException
    • writeBigInteger

      public static void writeBigInteger(@NonNull com.google.protobuf.CodedOutputStream output, @NonNull BigInteger value) throws IOException
      Throws:
      IOException
    • readObjectValue

      public static Object readObjectValue(@NonNull com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • readBigInteger

      public static BigInteger readBigInteger(@NonNull com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • validateDefaultValue

      public static Object validateDefaultValue(String id, ValueType valueType, Object value, Consumer<io.dialob.api.form.FormValidationError> errorListener)
    • createError

      public static io.dialob.api.form.FormValidationError createError(String itemId, String message)