fromString method

SchemaType fromString(
  1. String s
)

Implementation

static SchemaType fromString(String s) {
  if (s == null) return null;
  switch (s) {
    case 'array':
      return array;
    case 'boolean':
      return boolean;
    case 'integer':
      return integer;
    case 'number':
      return number;
    case 'null':
      return nullValue;
    case 'object':
      return object;
    case 'string':
      return string;
    default:
      return null;
  }
}