com.ning.api.client.access.Networks Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ning-api-java Show documentation
Show all versions of ning-api-java Show documentation
Java client library for accessing Ning external API
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);
}
}
}