com.googlecode.kevinarpe.papaya.container.builder.AbstractMapBuilder Maven / Gradle / Ivy
package com.googlecode.kevinarpe.papaya.container.builder;
/*
* #%L
* This file is part of Papaya.
* %%
* Copyright (C) 2013 - 2014 Kevin Connor ARPE ([email protected])
* %%
* Papaya is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GPL Classpath Exception:
* This project is subject to the "Classpath" exception as provided in
* the LICENSE file that accompanied this code.
*
* Papaya is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Papaya. If not, see .
* #L%
*/
import com.google.common.collect.ForwardingMap;
import com.google.common.collect.Maps;
import com.googlecode.kevinarpe.papaya.annotation.FullyTested;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Base class for all implementations of {@code MapBuilder}. The underlying map is an instance of
* {@link LinkedHashMap}.
*
* @author Kevin Connor ARPE ([email protected])
*
* @param
* type of map to build: extends Map<TKey, TValue>
* @param
* type of key for map
* @param
* type of value for map
*
* @see ForwardingMap
* @see MapBuilder
* @see HashMapBuilder
* @see LinkedHashMapBuilder
* @see ImmutableMapBuilder
* @see PropertiesBuilder
*/
@FullyTested
public abstract class AbstractMapBuilder
<
TMap extends Map,
TKey,
TValue
>
extends ForwardingMap
implements MapBuilder {
private final LinkedHashMap _map;
protected AbstractMapBuilder() {
_map = Maps.newLinkedHashMap();
}
@Override
protected final LinkedHashMap delegate() {
return _map;
}
@Override
public abstract TMap build();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy