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

com.ning.api.client.access.Networks Maven / Gradle / Ivy

There is a newer version: 0.5.1
Show newest version
package com.ning.api.client.access;

import com.ning.api.client.NingClientConfig;
import com.ning.api.client.access.impl.DefaultLister;
import com.ning.api.client.access.impl.PagedListImpl;
import com.ning.api.client.action.PagedList;
import com.ning.api.client.item.*;

/**
 * Support for Network items (/Network end point). Simple read-only interface
 * used for listing information about networks created by "current user"
 * (User whose credentials are used by the client)
 */
public class Networks  extends Items
{
    public Networks(NingConnection connection, NingClientConfig config)
    {
        super(connection, config, "Network", Network.class, NetworkField.class);
    }

    /*
    ///////////////////////////////////////////////////////////////////////
    // Public API: constructing request builders
    ///////////////////////////////////////////////////////////////////////
     */

    public Lister listerForAlpha(NetworkField firstField, NetworkField... otherFields) {
        return listerForAlpha(new Fields(NetworkField.class, firstField, otherFields));
    }
    
    public Lister listerForAlpha(Fields fields) {
        return new Lister(connection, config, endpointForAlpha(), fields);
    }
    
    /*
    ///////////////////////////////////////////////////////////////////////
    // Request builder classes (Creator, Updater, Finder, UserLister, NetworkCounter)
    ///////////////////////////////////////////////////////////////////////
     */    

    public static class Lister extends DefaultLister
    {
        protected Lister(NingConnection connection, NingClientConfig config, String endpoint,
                Fields fields)
        {
            super(connection, config, endpoint, fields, null, null, null);
        }

        @Override
        public PagedList list() {
            return new PagedListImpl(connection, config, endpoint,
                    Network.class, fields, null, null, null);
        }
    }    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy