All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kurento.client.Properties Maven / Gradle / Ivy

Go to download

Kurento Client The Kurento Client project allows server applications to control media server resources.

There is a newer version: 7.1.0
Show newest version

package org.kurento.client;

import java.util.HashMap;
import java.util.Map;

public class Properties {

  private Map values = new HashMap<>();

  public static Properties of(Object... params) {

    if (params.length % 2 != 0) {
      throw new IllegalArgumentException(
          "Each key should have a value (pair number of parameters). Parameters are: " + params);
    }

    Properties props = new Properties();

    for (int i = 0; i < params.length; i += 2) {
      if (!(params[i] instanceof String)) {
        throw new IllegalArgumentException(
            "Property key should be an String value. Parameter " + i + " is " + params[i]);
      }
      props.add((String) params[i], params[i + 1]);
    }

    return props;
  }

  public Properties add(String property, Object value) {
    values.put(property, value);
    return this;
  }

  public Object get(String property) {
    return values.get(property);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy