-
Notifications
You must be signed in to change notification settings - Fork 36
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
4 changed files
with
65 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package me.gilo.woodroid; | ||
|
||
import me.gilo.woodroid.data.ApiVersion; | ||
|
||
public class Builder { | ||
private String siteUrl; | ||
private ApiVersion apiVerion; | ||
private String consumerKey; | ||
private String consumerSecret; | ||
|
||
|
||
public Builder() { | ||
} | ||
|
||
public Builder setSiteUrl(String siteUrl) { | ||
this.siteUrl = siteUrl; | ||
return this; | ||
} | ||
|
||
public Builder setApiVersion(ApiVersion apiVerion) { | ||
this.apiVerion = apiVerion; | ||
return this; | ||
} | ||
|
||
public Builder setConsumerKey(String consumerKey) { | ||
this.consumerKey = consumerKey; | ||
return this; | ||
} | ||
|
||
public Builder setConsumerSecret(String consumerSecret) { | ||
this.consumerSecret = consumerSecret; | ||
return this; | ||
} | ||
|
||
|
||
public Woocommerce build() { | ||
return new Woocommerce(siteUrl, apiVerion, consumerKey, consumerSecret); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
woodroid/src/main/java/me/gilo/woodroid/data/ApiVersion.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package me.gilo.woodroid.data; | ||
|
||
public enum ApiVersion { | ||
API_VERSION1{ | ||
@Override | ||
public String toString() { | ||
return "1"; | ||
} | ||
}, | ||
API_VERSION2{ | ||
@Override | ||
public String toString() { | ||
return "2"; | ||
} | ||
}, | ||
API_VERSION3{ | ||
@Override | ||
public String toString() { | ||
return "3"; | ||
} | ||
}, | ||
} |