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

io.github.mmm.base.metainfo.impl.MetaInfoEmpty Maven / Gradle / Ivy

The newest version!
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.base.metainfo.impl;

import java.util.Collections;
import java.util.Iterator;

import io.github.mmm.base.metainfo.MetaInfo;

/**
 * Empty {@link MetaInfo} implementation.
 */
public final class MetaInfoEmpty extends AbstractMetaInfo {

  /** The singleton instance. */
  public static final MetaInfoEmpty INSTANCE = new MetaInfoEmpty();

  private MetaInfoEmpty() {

    super();
  }

  @Override
  public Iterator iterator() {

    return Collections.emptyIterator();
  }

  @Override
  public String getPlain(boolean inherit, String key) {

    return null;
  }

  @Override
  public int size() {

    return 0;
  }

  @Override
  public boolean isEmpty() {

    return true;
  }

  @Override
  public MetaInfo with(String key, String value) {

    return new MetaInfoValues(new MetaInfoValue(key, value), null);
  }

  @Override
  public MetaInfo with(String keyPrefix) {

    return this;
  }

  @Override
  public String toString(boolean sort) {

    return "{}";
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy