// Path: src/main/java/com/cloudera/director/spi/v2/model/DisplayProperty.java
// public interface DisplayProperty extends Property<DisplayProperty.Widget> {
// 
//   /**
//    * Represents the widget used to display a property.
//    */
//   enum Widget {
// 
//     /**
//      * Radio button widget.
//      */
//     RADIO,
// 
//     /**
//      * Checkbox widget.
//      */
//     CHECKBOX,
// 
//     /**
//      * Text box widget.
//      */
//     TEXT,
// 
//     /**
//      * Text area widget.
//      */
//     TEXTAREA,
// 
//     /**
//      * File download widget.
//      */
//     FILE,
// 
//     /**
//      * Multiple display widget for a fixed set of values.
//      */
//     MULTI
//   }
// 
//   /**
//    * Returns the display key.
//    *
//    * @return the display key
//    */
//   String getDisplayKey();
// }
// 
// Path: src/main/java/com/cloudera/director/spi/v2/model/DisplayPropertyToken.java
// public interface DisplayPropertyToken {
// 
//   /**
//    * Returns the display property.
//    *
//    * @return the display property
//    */
//   DisplayProperty unwrap();
// }


import com.cloudera.director.spi.v2.model.DisplayProperty;
import com.cloudera.director.spi.v2.model.DisplayPropertyToken;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/*
 * Copyright (c) 2015 Cloudera, Inc.
 *
 * 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 com.cloudera.director.spi.v2.util;



/**
 * Provides utility methods for manipulating display properties.
 */
public final class DisplayPropertiesUtil {

  /**
   * Private constructor to prevent instantiation.
   */
  private DisplayPropertiesUtil() {
  }

  /**
   * Returns an unmodifiable list containing the display properties identified by the
   * specified tokens.
   *
   * @param tokens the display property tokens
   * @param <T>    the type of display property token
   * @return an unmodifiable list containing the specified display properties
   */
  public static <T extends DisplayPropertyToken>
// Path: src/main/java/com/cloudera/director/spi/v2/model/DisplayProperty.java
// public interface DisplayProperty extends Property<DisplayProperty.Widget> {
// 
//   /**
//    * Represents the widget used to display a property.
//    */
//   enum Widget {
// 
//     /**
//      * Radio button widget.
//      */
//     RADIO,
// 
//     /**
//      * Checkbox widget.
//      */
//     CHECKBOX,
// 
//     /**
//      * Text box widget.
//      */
//     TEXT,
// 
//     /**
//      * Text area widget.
//      */
//     TEXTAREA,
// 
//     /**
//      * File download widget.
//      */
//     FILE,
// 
//     /**
//      * Multiple display widget for a fixed set of values.
//      */
//     MULTI
//   }
// 
//   /**
//    * Returns the display key.
//    *
//    * @return the display key
//    */
//   String getDisplayKey();
// }
// 
// Path: src/main/java/com/cloudera/director/spi/v2/model/DisplayPropertyToken.java
// public interface DisplayPropertyToken {
// 
//   /**
//    * Returns the display property.
//    *
//    * @return the display property
//    */
//   DisplayProperty unwrap();
// }


// Path: src/main/java/com/cloudera/director/spi/v2/util/DisplayPropertiesUtil.java
import com.cloudera.director.spi.v2.model.DisplayProperty;
import com.cloudera.director.spi.v2.model.DisplayPropertyToken;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/*
 * Copyright (c) 2015 Cloudera, Inc.
 *
 * 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 com.cloudera.director.spi.v2.util;



/**
 * Provides utility methods for manipulating display properties.
 */
public final class DisplayPropertiesUtil {

  /**
   * Private constructor to prevent instantiation.
   */
  private DisplayPropertiesUtil() {
  }

  /**
   * Returns an unmodifiable list containing the display properties identified by the
   * specified tokens.
   *
   * @param tokens the display property tokens
   * @param <T>    the type of display property token
   * @return an unmodifiable list containing the specified display properties
   */
  public static <T extends DisplayPropertyToken>
  List<DisplayProperty> asDisplayPropertyList(T[] tokens) {