forked from stil4m/mollie-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
216 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 27 additions & 27 deletions
54
src/main/java/nl/stil4m/mollie/concepts/AbstractConcept.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
package nl.stil4m.mollie.concepts; | ||
|
||
import java.io.IOException; | ||
import java.nio.charset.UnsupportedCharsetException; | ||
|
||
import org.apache.http.HttpEntity; | ||
import org.apache.http.client.methods.HttpUriRequest; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
|
||
import nl.stil4m.mollie.ResponseOrError; | ||
import nl.stil4m.mollie.domain.Page; | ||
import org.apache.http.HttpEntity; | ||
import org.apache.http.client.methods.HttpUriRequest; | ||
|
||
import java.io.IOException; | ||
import java.nio.charset.UnsupportedCharsetException; | ||
|
||
public interface Concept<T extends Object> { | ||
String url(String... elements); | ||
|
||
ResponseOrError<Page<T>> requestPage(HttpUriRequest get) throws IOException; | ||
|
||
ResponseOrError<T> requestSingle(HttpUriRequest get) throws IOException; | ||
|
||
ResponseOrError<Void> requestVoid(HttpUriRequest get) throws IOException; | ||
|
||
HttpEntity buildHttpEntity(Object value) throws UnsupportedCharsetException, JsonProcessingException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
package nl.stil4m.mollie.concepts; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
|
||
import nl.stil4m.mollie.RequestExecutor; | ||
import nl.stil4m.mollie.domain.CreateCustomer; | ||
import nl.stil4m.mollie.domain.Customer; | ||
import nl.stil4m.mollie.domain.Page; | ||
import nl.stil4m.mollie.domain.UpdateCustomer; | ||
|
||
public class Customers extends AbstractConcept<Customer> implements ListAll<Customer>,GetById<Customer>,Create<Customer,CreateCustomer>,Update<Customer,UpdateCustomer> { | ||
private static final TypeReference<Page<Customer>> PAGE_TYPE = new TypeReference<Page<Customer>>() {}; | ||
private static final TypeReference<Customer> SINGLE_TYPE = new TypeReference<Customer>() {}; | ||
public class Customers extends AbstractConcept<Customer> implements ListAll<Customer>, GetById<Customer>, Create<Customer, CreateCustomer>, Update<Customer, UpdateCustomer> { | ||
private static final TypeReference<Page<Customer>> PAGE_TYPE = new TypeReference<Page<Customer>>() { | ||
}; | ||
private static final TypeReference<Customer> SINGLE_TYPE = new TypeReference<Customer>() { | ||
}; | ||
|
||
public Customers(String apiKey, String endpoint, RequestExecutor requestExecutor) { | ||
super(apiKey,requestExecutor,SINGLE_TYPE,PAGE_TYPE,endpoint,"customers"); | ||
super(apiKey, requestExecutor, SINGLE_TYPE, PAGE_TYPE, endpoint, "customers"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package nl.stil4m.mollie.concepts; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
|
||
import nl.stil4m.mollie.RequestExecutor; | ||
import nl.stil4m.mollie.domain.Issuer; | ||
import nl.stil4m.mollie.domain.Page; | ||
|
||
public class Issuers extends AbstractConcept<Issuer> implements ListAll<Issuer>,GetById<Issuer> { | ||
private static final TypeReference<Page<Issuer>> PAGE_TYPE = new TypeReference<Page<Issuer>>() {}; | ||
private static final TypeReference<Issuer> SINGLE_TYPE = new TypeReference<Issuer>() {}; | ||
|
||
public class Issuers extends AbstractConcept<Issuer> implements ListAll<Issuer>, GetById<Issuer> { | ||
private static final TypeReference<Page<Issuer>> PAGE_TYPE = new TypeReference<Page<Issuer>>() { | ||
}; | ||
private static final TypeReference<Issuer> SINGLE_TYPE = new TypeReference<Issuer>() { | ||
}; | ||
|
||
public Issuers(String apiKey, String endpoint, RequestExecutor requestExecutor) { | ||
super(apiKey,requestExecutor,SINGLE_TYPE,PAGE_TYPE,endpoint,"issuers"); | ||
super(apiKey, requestExecutor, SINGLE_TYPE, PAGE_TYPE, endpoint, "issuers"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
package nl.stil4m.mollie.concepts; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
|
||
import nl.stil4m.mollie.RequestExecutor; | ||
import nl.stil4m.mollie.domain.CreateMandate; | ||
import nl.stil4m.mollie.domain.Mandate; | ||
import nl.stil4m.mollie.domain.Page; | ||
|
||
public class Mandates extends AbstractConcept<Mandate> implements ListAll<Mandate>,GetById<Mandate>,Create<Mandate,CreateMandate>,Delete<Mandate> { | ||
private static final TypeReference<Page<Mandate>> PAGE_TYPE = new TypeReference<Page<Mandate>>() {}; | ||
private static final TypeReference<Mandate> SINGLE_TYPE = new TypeReference<Mandate>() {}; | ||
public class Mandates extends AbstractConcept<Mandate> implements ListAll<Mandate>, GetById<Mandate>, Create<Mandate, CreateMandate>, Delete<Mandate> { | ||
private static final TypeReference<Page<Mandate>> PAGE_TYPE = new TypeReference<Page<Mandate>>() { | ||
}; | ||
private static final TypeReference<Mandate> SINGLE_TYPE = new TypeReference<Mandate>() { | ||
}; | ||
|
||
public Mandates(String apiKey, String endpoint, RequestExecutor requestExecutor, String customerId) { | ||
super(apiKey,requestExecutor,SINGLE_TYPE,PAGE_TYPE,endpoint,"customers",customerId,"mandates"); | ||
super(apiKey, requestExecutor, SINGLE_TYPE, PAGE_TYPE, endpoint, "customers", customerId, "mandates"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package nl.stil4m.mollie.concepts; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
|
||
import nl.stil4m.mollie.RequestExecutor; | ||
import nl.stil4m.mollie.domain.Method; | ||
import nl.stil4m.mollie.domain.Page; | ||
|
||
public class Methods extends AbstractConcept<Method> implements ListAll<Method>,GetById<Method> { | ||
private static final TypeReference<Page<Method>> PAGE_TYPE = new TypeReference<Page<Method>>() {}; | ||
private static final TypeReference<Method> SINGLE_TYPE = new TypeReference<Method>() {}; | ||
|
||
public class Methods extends AbstractConcept<Method> implements ListAll<Method>, GetById<Method> { | ||
private static final TypeReference<Page<Method>> PAGE_TYPE = new TypeReference<Page<Method>>() { | ||
}; | ||
private static final TypeReference<Method> SINGLE_TYPE = new TypeReference<Method>() { | ||
}; | ||
|
||
public Methods(String apiKey, String endpoint, RequestExecutor requestExecutor) { | ||
super(apiKey,requestExecutor,SINGLE_TYPE,PAGE_TYPE,endpoint,"methods"); | ||
super(apiKey, requestExecutor, SINGLE_TYPE, PAGE_TYPE, endpoint, "methods"); | ||
} | ||
} |
Oops, something went wrong.