/*
 * Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
 * and other contributors as indicated by the @author tags.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.hawkular.metrics.client.common;

/**
 * Type of the metric
 * @author Heiko W. Rupp
 */
public enum MetricType {
    SIMPLE,
    TIMING,
    COUNTER,
    GAUGE;

    public static MetricType from(String type) {
        switch (type) {
        case "c":
            return COUNTER;
        case "g":
            return GAUGE;
        case "ms":
            return TIMING;
        default:
            return SIMPLE;
        }
    }
}

@@ -21,9 +21,9 @@
 -201
-5
+6
  Red
@@ -809,50 +809,56 @@
     
-SIMPLE,%0A    TIMING,%0A    COUNTER,%0A    GAUGE
+COUNTER,%0A    GAUGE,%0A    AVAILABILITY,%0A    STRING
 ;%0A%0A 
@@ -1033,17 +1033,67 @@
   case %22
-m
+a%22:%0A            return AVAILABILITY;%0A        case %22
 s%22:%0A    
@@ -1111,11 +1111,11 @@
 urn 
-TIM
+STR
 ING;
@@ -1148,21 +1148,63 @@
     
-return SIMPLE
+throw new IllegalArgumentException(%22Bad type: %22 + type)
 ;%0A  

update the commons client API to support avail and string types