Пример #1
0
  public Address setAddress(String value) {

    if (StringUtil.isNullOrEmpty(value)) {
      return this;
    }

    this.value = value;

    String[] parts = value.split("/");

    if (CollectionUtil.isNullOrEmpty(parts)) {
      return null;
    }

    if (parts.length > 1) {
      this.scheme = parts[0].replace(":", "");
      this.authority = parts[1];
    }

    if (parts.length > 2) {
      this.query = parts[2];
    }

    return this;
  }
Пример #2
0
  public void load(TConfig data) {
    if (CollectionUtil.isNullOrEmpty(destroyables) || data == null) {
      return;
    }

    // we know that destroyables are kept around. I hope this is a safe assumption.
    for (Destroyable destroyable : destroyables) {
      if (destroyable instanceof ConfigurationAware) {
        ConfigurationAware<TConfig> configurable = (ConfigurationAware<TConfig>) destroyable;

        configurable.load(data);
      }
    }
  }