Class Utils


  • public class Utils
    extends Object
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • 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)
      • mapValueTypeToType

        @Nonnull
        public static String mapValueTypeToType​(@Nonnull
                                                ValueType valueType)
      • isGroupType

        public static boolean isGroupType​(@Nonnull
                                          ItemState itemState)
      • isQuestionType

        public static boolean isQuestionType​(@Nonnull
                                             ItemState itemState)
      • 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
      • readObjectValue

        public static Object readObjectValue​(@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)