parse static method

MojangSiteStatus parse(
  1. String data
)

Gets the MojangSiteStatus from given data. data should be 'red', 'yellow', 'green'. Otherwise, MojangSiteStatus.Unavailable will be returned.

Implementation

static MojangSiteStatus parse(String data) {
  switch (data) {
    case 'red':
      return MojangSiteStatus.unavailable;
    case 'yellow':
      return MojangSiteStatus.someIssues;
    case 'green':
      return MojangSiteStatus.available;
    default:
      return MojangSiteStatus.unavailable;
  }
}