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

org.modelmapper.spi.Tokens Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package org.modelmapper.spi;

import java.util.Arrays;
import java.util.Iterator;

/**
 * Represents tokens of a property
 *
 * @author  Chun Han Hsiao
 */
public class Tokens implements Iterable {
  public static Tokens of(String... tokens) {
    return new Tokens(tokens);
  }

  private String[] tokens;

  private Tokens(String[] tokens) {
    this.tokens = tokens;
  }

  public String token(int pos) {
    return tokens[pos];
  }

  public int size() {
    return tokens.length;
  }

  @Override
  public Iterator iterator() {
    return Arrays.asList(tokens).iterator();
  }

  @Override
  public String toString() {
    return Arrays.toString(tokens);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy