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

com.github.grzesiek_galezowski.collections.readonly.factory.ReadOnlyCollections Maven / Gradle / Ivy

The newest version!
package com.github.grzesiek_galezowski.collections.readonly.factory;

import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlyCollectionWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlyDequeWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlyListWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlyMapWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlyNavigableMapWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlyNavigableSetWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlyQueueWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlySetWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlySortedMapWrapper;
import com.github.grzesiek_galezowski.collections.readonly.implementation.ReadOnlySortedSetWrapper;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlyCollection;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlyDeque;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlyList;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlyMap;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlyNavigableMap;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlyNavigableSet;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlyQueue;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlySet;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlySortedMap;
import com.github.grzesiek_galezowski.collections.readonly.interfaces.ReadOnlySortedSet;

import java.util.Collection;
import java.util.Deque;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.NavigableSet;
import java.util.Queue;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;

public class ReadOnlyCollections {
    public static  ReadOnlyCollection readOnly(final Collection collection) {
        return new ReadOnlyCollectionWrapper<>(collection);
    }

    public static  ReadOnlyList readOnly(final List list) {
        return new ReadOnlyListWrapper<>(list);
    }

    public static  ReadOnlySet readOnly(final Set set) {
        return new ReadOnlySetWrapper<>(set);
    }

    public static  ReadOnlyQueue readOnly(final Queue queue) {
        return new ReadOnlyQueueWrapper<>(queue);
    }

    public static  ReadOnlyDeque readOnly(final Deque deque) {
        return new ReadOnlyDequeWrapper<>(deque);
    }

    public static  ReadOnlyNavigableSet readOnly(final NavigableSet navigableSet) {
        return new ReadOnlyNavigableSetWrapper<>(navigableSet);
    }

    public static  ReadOnlySortedSet readOnly(final SortedSet sortedSet) {
        return new ReadOnlySortedSetWrapper<>(sortedSet);
    }

    public static  ReadOnlyMap readOnly(final Map map) {
        return new ReadOnlyMapWrapper<>(map);
    }
    public static  ReadOnlySortedMap readOnly(final SortedMap sortedMap) {
        return new ReadOnlySortedMapWrapper<>(sortedMap);
    }
    public static  ReadOnlyNavigableMap readOnly(final NavigableMap navigableMap) {
        return new ReadOnlyNavigableMapWrapper<>(navigableMap);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy