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

restx.specs.GivenUUIDGenerator Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx.specs;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import restx.common.MoreStrings;

import java.util.List;

/**
 * @author fcamblor
 */
public class GivenUUIDGenerator implements Given {
    private final ImmutableList playbackUUIDs;

    public GivenUUIDGenerator(ImmutableList playbackUUIDs) {
        this.playbackUUIDs = playbackUUIDs;
    }

    public ImmutableList getPlaybackUUIDs() {
        return playbackUUIDs;
    }

    public GivenUUIDGenerator concat(String uuid){
        return new GivenUUIDGenerator(ImmutableList.builder().addAll(playbackUUIDs).add(uuid).build());
    }

    @Override
    public void toString(StringBuilder sb) {
        sb.append(String.format("  - uuids: %s%n",
                Joiner.on(",").join(Iterables.transform(playbackUUIDs, MoreStrings.SURROUND_WITH_DOUBLE_QUOTES))));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy