public class

DefaultRepository

extends Object
implements Repository<T>
java.lang.Object
   ↳ com.coupa.api.impl.DefaultRepository<T extends com.coupa.api.Identifiable>

Class Overview

Code based on Coupa4j

Summary

Fields
private Client client
private static final SimpleDateFormat dateFormat
private int parseLimit
private Class<T extends Identifiable> resourceClass
private String resourceUrl
Public Constructors
DefaultRepository(Client coupaServer, Class<T> resourceClass, String resourceUrl)
Public Methods
List<T> findAll()
List<T> findAll(int offset, int limit)
List<T> findAll(T prototype, boolean exactMatch)
List<T> findAll(int offset)
List<T> findAll(T prototype)
List<T> findAll(Map<String, String> conditions, boolean exactMatch, int offset, Integer limit, Date dateLimit)
List<T> findAll(Map<String, String> conditions, boolean exactMatch, int offset, Integer limit)
T findById(long id)
static <T extends Resource> Repository<T> newRepository(Client coupaServer, Class<T> resourceClass)
static <T extends Resource> Repository<T> newRepository(Client coupaServer, Class<T> resourceClass, String resourceName)
T save(T resource)
Protected Methods
static String camelCaseToRubyCase(String simpleName)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.coupa.api.Repository

Fields

private Client client

private static final SimpleDateFormat dateFormat

private int parseLimit

private Class<T extends Identifiable> resourceClass

private String resourceUrl

Public Constructors

public DefaultRepository (Client coupaServer, Class<T> resourceClass, String resourceUrl)

Parameters
coupaServer
resourceClass
resourceUrl

Public Methods

public List<T> findAll ()

public List<T> findAll (int offset, int limit)

Parameters
offset
limit

public List<T> findAll (T prototype, boolean exactMatch)

Parameters
prototype
exactMatch

public List<T> findAll (int offset)

Parameters
offset

public List<T> findAll (T prototype)

Parameters
prototype

public List<T> findAll (Map<String, String> conditions, boolean exactMatch, int offset, Integer limit, Date dateLimit)

Parameters
conditions
exactMatch
offset
limit
dateLimit

public List<T> findAll (Map<String, String> conditions, boolean exactMatch, int offset, Integer limit)

Parameters
conditions
exactMatch
offset
limit

public T findById (long id)

Parameters
id

public static Repository<T> newRepository (Client coupaServer, Class<T> resourceClass)

Parameters
coupaServer
resourceClass

public static Repository<T> newRepository (Client coupaServer, Class<T> resourceClass, String resourceName)

Parameters
coupaServer
resourceClass
resourceName

public T save (T resource)

Parameters
resource

Protected Methods

protected static String camelCaseToRubyCase (String simpleName)

Parameters
simpleName