Example usage for org.apache.thrift TFieldRequirementType REQUIRED

List of usage examples for org.apache.thrift TFieldRequirementType REQUIRED

Introduction

In this page you can find the example usage for org.apache.thrift TFieldRequirementType REQUIRED.

Prototype

byte REQUIRED

To view the source code for org.apache.thrift TFieldRequirementType REQUIRED.

Click Source Link

Usage

From source file:com.linecorp.armeria.server.docs.RequirementType.java

License:Apache License

static RequirementType of(byte requirementType) {
    switch (requirementType) {
    case TFieldRequirementType.REQUIRED:
        return RequirementType.REQUIRED;
    case TFieldRequirementType.OPTIONAL:
        return RequirementType.OPTIONAL;
    case TFieldRequirementType.DEFAULT:
        return RequirementType.DEFAULT;
    default://from   w w  w  . j  a v a 2 s  .c  o  m
        throw new IllegalArgumentException("unknown requirement type: " + requirementType);
    }
}

From source file:com.linecorp.armeria.server.thrift.ThriftDocServicePlugin.java

License:Apache License

private static FieldRequirement convertRequirement(byte value) {
    switch (value) {
    case TFieldRequirementType.REQUIRED:
        return FieldRequirement.REQUIRED;
    case TFieldRequirementType.OPTIONAL:
        return FieldRequirement.OPTIONAL;
    case TFieldRequirementType.DEFAULT:
        return FieldRequirement.DEFAULT;
    default://from   ww  w .  j  a v a 2s  . c  o m
        throw new IllegalArgumentException("unknown requirement type: " + value);
    }
}