repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteAllPushesRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteAllPushesRequest extends DeleteRequest<Void> { public DeleteAllPushesRequest() {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteAllPushesRequest.java import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteAllPushesRequest extends DeleteRequest<Void> { public DeleteAllPushesRequest() {
super(Urls.PUSHES);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/ListResponse.java // @Getter // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class ListResponse { // // /** // * The list of accounts // */ // private List<Account> accounts; // // /** // * The list of blocked users // */ // private List<Block> blocks; // // /** // * The list of own channels // */ // private List<OwnChannel> channels; // // /** // * The list of own chats // */ // private List<Chat> chats; // // /** // * The list of created oauth clients // */ // private List<OAuthClient> clients; // // /** // * The list of contacts // */ // private List<Contact> contacts; // // /** // * The list of devices // */ // private List<Device> devices; // // /** // * The list of granted clients // */ // private List<Grant> grants; // // /** // * The list of sent or received pushes // */ // private List<Push> pushes; // // /** // * The list of subscriptions // */ // private List<Subscription> subscriptions; // // /** // * Cursor for pagination // */ // @Setter // private String cursor; // // public ListResponse addAll(ListResponse other) { // accounts.addAll(other.getAccounts()); // channels.addAll(other.getChannels()); // chats.addAll(other.getChats()); // clients.addAll(other.getClients()); // contacts.addAll(other.getContacts()); // devices.addAll(other.getDevices()); // grants.addAll(other.getGrants()); // pushes.addAll(other.getPushes()); // subscriptions.addAll(other.getSubscriptions()); // return this; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // }
import com.github.sheigutn.pushbullet.items.ListResponse; import lombok.Data; import lombok.experimental.Accessors; import com.github.sheigutn.pushbullet.http.GetRequest; import org.apache.http.client.utils.URIBuilder;
package com.github.sheigutn.pushbullet.http.defaults; @Accessors(chain = true) @Data
// Path: src/main/java/com/github/sheigutn/pushbullet/items/ListResponse.java // @Getter // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class ListResponse { // // /** // * The list of accounts // */ // private List<Account> accounts; // // /** // * The list of blocked users // */ // private List<Block> blocks; // // /** // * The list of own channels // */ // private List<OwnChannel> channels; // // /** // * The list of own chats // */ // private List<Chat> chats; // // /** // * The list of created oauth clients // */ // private List<OAuthClient> clients; // // /** // * The list of contacts // */ // private List<Contact> contacts; // // /** // * The list of devices // */ // private List<Device> devices; // // /** // * The list of granted clients // */ // private List<Grant> grants; // // /** // * The list of sent or received pushes // */ // private List<Push> pushes; // // /** // * The list of subscriptions // */ // private List<Subscription> subscriptions; // // /** // * Cursor for pagination // */ // @Setter // private String cursor; // // public ListResponse addAll(ListResponse other) { // accounts.addAll(other.getAccounts()); // channels.addAll(other.getChannels()); // chats.addAll(other.getChats()); // clients.addAll(other.getClients()); // contacts.addAll(other.getContacts()); // devices.addAll(other.getDevices()); // grants.addAll(other.getGrants()); // pushes.addAll(other.getPushes()); // subscriptions.addAll(other.getSubscriptions()); // return this; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java import com.github.sheigutn.pushbullet.items.ListResponse; import lombok.Data; import lombok.experimental.Accessors; import com.github.sheigutn.pushbullet.http.GetRequest; import org.apache.http.client.utils.URIBuilder; package com.github.sheigutn.pushbullet.http.defaults; @Accessors(chain = true) @Data
public class ListItemsRequest extends GetRequest<ListResponse> {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/ListResponse.java // @Getter // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class ListResponse { // // /** // * The list of accounts // */ // private List<Account> accounts; // // /** // * The list of blocked users // */ // private List<Block> blocks; // // /** // * The list of own channels // */ // private List<OwnChannel> channels; // // /** // * The list of own chats // */ // private List<Chat> chats; // // /** // * The list of created oauth clients // */ // private List<OAuthClient> clients; // // /** // * The list of contacts // */ // private List<Contact> contacts; // // /** // * The list of devices // */ // private List<Device> devices; // // /** // * The list of granted clients // */ // private List<Grant> grants; // // /** // * The list of sent or received pushes // */ // private List<Push> pushes; // // /** // * The list of subscriptions // */ // private List<Subscription> subscriptions; // // /** // * Cursor for pagination // */ // @Setter // private String cursor; // // public ListResponse addAll(ListResponse other) { // accounts.addAll(other.getAccounts()); // channels.addAll(other.getChannels()); // chats.addAll(other.getChats()); // clients.addAll(other.getClients()); // contacts.addAll(other.getContacts()); // devices.addAll(other.getDevices()); // grants.addAll(other.getGrants()); // pushes.addAll(other.getPushes()); // subscriptions.addAll(other.getSubscriptions()); // return this; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // }
import com.github.sheigutn.pushbullet.items.ListResponse; import lombok.Data; import lombok.experimental.Accessors; import com.github.sheigutn.pushbullet.http.GetRequest; import org.apache.http.client.utils.URIBuilder;
package com.github.sheigutn.pushbullet.http.defaults; @Accessors(chain = true) @Data
// Path: src/main/java/com/github/sheigutn/pushbullet/items/ListResponse.java // @Getter // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class ListResponse { // // /** // * The list of accounts // */ // private List<Account> accounts; // // /** // * The list of blocked users // */ // private List<Block> blocks; // // /** // * The list of own channels // */ // private List<OwnChannel> channels; // // /** // * The list of own chats // */ // private List<Chat> chats; // // /** // * The list of created oauth clients // */ // private List<OAuthClient> clients; // // /** // * The list of contacts // */ // private List<Contact> contacts; // // /** // * The list of devices // */ // private List<Device> devices; // // /** // * The list of granted clients // */ // private List<Grant> grants; // // /** // * The list of sent or received pushes // */ // private List<Push> pushes; // // /** // * The list of subscriptions // */ // private List<Subscription> subscriptions; // // /** // * Cursor for pagination // */ // @Setter // private String cursor; // // public ListResponse addAll(ListResponse other) { // accounts.addAll(other.getAccounts()); // channels.addAll(other.getChannels()); // chats.addAll(other.getChats()); // clients.addAll(other.getClients()); // contacts.addAll(other.getContacts()); // devices.addAll(other.getDevices()); // grants.addAll(other.getGrants()); // pushes.addAll(other.getPushes()); // subscriptions.addAll(other.getSubscriptions()); // return this; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java import com.github.sheigutn.pushbullet.items.ListResponse; import lombok.Data; import lombok.experimental.Accessors; import com.github.sheigutn.pushbullet.http.GetRequest; import org.apache.http.client.utils.URIBuilder; package com.github.sheigutn.pushbullet.http.defaults; @Accessors(chain = true) @Data
public class ListItemsRequest extends GetRequest<ListResponse> {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableFilePush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java // @Getter // public class UploadFile { // // /** // * The mime type of this file // */ // @SerializedName("file_type") // private String fileType; // // /** // * The name of this file // */ // @SerializedName("file_name") // private String fileName; // // /** // * The url to this file // */ // @SerializedName("file_url") // private String fileUrl; // // /** // * The upload url that this file should be uploaded to // */ // @SerializedName("upload_url") // private String uploadUrl; // // /** // * The data for the upload to AWS // */ // private AwsAuthData data; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.file.UploadFile; import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true)
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java // @Getter // public class UploadFile { // // /** // * The mime type of this file // */ // @SerializedName("file_type") // private String fileType; // // /** // * The name of this file // */ // @SerializedName("file_name") // private String fileName; // // /** // * The url to this file // */ // @SerializedName("file_url") // private String fileUrl; // // /** // * The upload url that this file should be uploaded to // */ // @SerializedName("upload_url") // private String uploadUrl; // // /** // * The data for the upload to AWS // */ // private AwsAuthData data; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableFilePush.java import com.github.sheigutn.pushbullet.items.file.UploadFile; import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true)
public class SendableFilePush extends SendablePush {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableFilePush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java // @Getter // public class UploadFile { // // /** // * The mime type of this file // */ // @SerializedName("file_type") // private String fileType; // // /** // * The name of this file // */ // @SerializedName("file_name") // private String fileName; // // /** // * The url to this file // */ // @SerializedName("file_url") // private String fileUrl; // // /** // * The upload url that this file should be uploaded to // */ // @SerializedName("upload_url") // private String uploadUrl; // // /** // * The data for the upload to AWS // */ // private AwsAuthData data; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.file.UploadFile; import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableFilePush extends SendablePush { /** * The body for this push */ private String body; /** * The mime type of the file */ @SerializedName("file_type") private String fileType; /** * The name of the file */ @SerializedName("file_name") private String fileName; /** * The url of the file */ @SerializedName("file_url") private String fileUrl; public SendableFilePush() {
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java // @Getter // public class UploadFile { // // /** // * The mime type of this file // */ // @SerializedName("file_type") // private String fileType; // // /** // * The name of this file // */ // @SerializedName("file_name") // private String fileName; // // /** // * The url to this file // */ // @SerializedName("file_url") // private String fileUrl; // // /** // * The upload url that this file should be uploaded to // */ // @SerializedName("upload_url") // private String uploadUrl; // // /** // * The data for the upload to AWS // */ // private AwsAuthData data; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableFilePush.java import com.github.sheigutn.pushbullet.items.file.UploadFile; import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableFilePush extends SendablePush { /** * The body for this push */ private String body; /** * The mime type of the file */ @SerializedName("file_type") private String fileType; /** * The name of the file */ @SerializedName("file_name") private String fileName; /** * The url of the file */ @SerializedName("file_url") private String fileUrl; public SendableFilePush() {
super(PushType.FILE);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableFilePush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java // @Getter // public class UploadFile { // // /** // * The mime type of this file // */ // @SerializedName("file_type") // private String fileType; // // /** // * The name of this file // */ // @SerializedName("file_name") // private String fileName; // // /** // * The url to this file // */ // @SerializedName("file_url") // private String fileUrl; // // /** // * The upload url that this file should be uploaded to // */ // @SerializedName("upload_url") // private String uploadUrl; // // /** // * The data for the upload to AWS // */ // private AwsAuthData data; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.file.UploadFile; import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableFilePush extends SendablePush { /** * The body for this push */ private String body; /** * The mime type of the file */ @SerializedName("file_type") private String fileType; /** * The name of the file */ @SerializedName("file_name") private String fileName; /** * The url of the file */ @SerializedName("file_url") private String fileUrl; public SendableFilePush() { super(PushType.FILE); } /** * * @param body The body for this messagse * @param file The file to send */
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java // @Getter // public class UploadFile { // // /** // * The mime type of this file // */ // @SerializedName("file_type") // private String fileType; // // /** // * The name of this file // */ // @SerializedName("file_name") // private String fileName; // // /** // * The url to this file // */ // @SerializedName("file_url") // private String fileUrl; // // /** // * The upload url that this file should be uploaded to // */ // @SerializedName("upload_url") // private String uploadUrl; // // /** // * The data for the upload to AWS // */ // private AwsAuthData data; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableFilePush.java import com.github.sheigutn.pushbullet.items.file.UploadFile; import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableFilePush extends SendablePush { /** * The body for this push */ private String body; /** * The mime type of the file */ @SerializedName("file_type") private String fileType; /** * The name of the file */ @SerializedName("file_name") private String fileName; /** * The url of the file */ @SerializedName("file_url") private String fileUrl; public SendableFilePush() { super(PushType.FILE); } /** * * @param body The body for this messagse * @param file The file to send */
public SendableFilePush(String body, UploadFile file) {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/BlockUserRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Block extends PushbulletObject implements Deletable { // // private BlockedUser user; // // @Override // public void delete() { // if(!isActive()) return; // getPushbullet().executeRequest(new DeleteSpecificBlockRequest(getIdentity())); // setActive(false); // } // }
import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.block.Block; import com.google.gson.Gson; import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post; public class BlockUserRequest extends PostRequest<Block> { private String email; public BlockUserRequest(String userEmail) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Block extends PushbulletObject implements Deletable { // // private BlockedUser user; // // @Override // public void delete() { // if(!isActive()) return; // getPushbullet().executeRequest(new DeleteSpecificBlockRequest(getIdentity())); // setActive(false); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/BlockUserRequest.java import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.block.Block; import com.google.gson.Gson; import org.apache.http.client.methods.HttpPost; package com.github.sheigutn.pushbullet.http.defaults.post; public class BlockUserRequest extends PostRequest<Block> { private String email; public BlockUserRequest(String userEmail) {
super(Urls.BLOCKS);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListDevicesRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get; public class ListDevicesRequest extends ListItemsRequest { public ListDevicesRequest() {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListDevicesRequest.java import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.get; public class ListDevicesRequest extends ListItemsRequest { public ListDevicesRequest() {
super(Urls.DEVICES);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListGrantsRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get; public class ListGrantsRequest extends ListItemsRequest { public ListGrantsRequest() {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListGrantsRequest.java import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.get; public class ListGrantsRequest extends ListItemsRequest { public ListGrantsRequest() {
super(Urls.GRANTS);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableLinkPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true)
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableLinkPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true)
public class SendableLinkPush extends SendablePush {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableLinkPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableLinkPush extends SendablePush { /** * The title of this push */ private String title; /** * The body of this push */ private String body; private String url; public SendableLinkPush() {
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableLinkPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableLinkPush extends SendablePush { /** * The title of this push */ private String title; /** * The body of this push */ private String body; private String url; public SendableLinkPush() {
super(PushType.LINK);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/device/Phonebook.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletContainer.java // @Data // public abstract class PushbulletContainer { // // /** // * The pushbullet instance that this object is linked to // */ // private transient Pushbullet pushbullet; // }
import com.github.sheigutn.pushbullet.items.PushbulletContainer; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import java.util.List;
package com.github.sheigutn.pushbullet.items.device; @Getter @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletContainer.java // @Data // public abstract class PushbulletContainer { // // /** // * The pushbullet instance that this object is linked to // */ // private transient Pushbullet pushbullet; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/device/Phonebook.java import com.github.sheigutn.pushbullet.items.PushbulletContainer; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import java.util.List; package com.github.sheigutn.pushbullet.items.device; @Getter @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Phonebook extends PushbulletContainer {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/stream/message/PushStreamMessage.java
// Path: src/main/java/com/github/sheigutn/pushbullet/ephemeral/Ephemeral.java // @Accessors(chain = true) // @Data // public class Ephemeral { // // /** // * The type of this ephemeral // */ // @Setter(AccessLevel.PROTECTED) // private EphemeralType type; // // /** // * The identity of the user this ephemeral came from // */ // @SerializedName("source_user_iden") // private String sourceUserIdentity; // // public enum EphemeralType { // // /** // * Used for SMS replies // */ // @SerializedName("messaging_extension_reply") // SMS_REPLY, // // /** // * Used for universal copy paste // */ // @SerializedName("clip") // CLIP, // // /** // * Used for notification mirroring // */ // @SerializedName("mirror") // NOTIFICATION, // // /** // * Used for notification dismissal // */ // @SerializedName("dismissal") // DISMISSAL; // } // }
import com.github.sheigutn.pushbullet.ephemeral.Ephemeral; import lombok.Data; import lombok.ToString; import java.util.List;
package com.github.sheigutn.pushbullet.stream.message; @Data @ToString(callSuper = true) public class PushStreamMessage extends StreamMessage { public PushStreamMessage() { setType(StreamMessageType.PUSH); } /** * The ephemeral that has been transferred with this message */
// Path: src/main/java/com/github/sheigutn/pushbullet/ephemeral/Ephemeral.java // @Accessors(chain = true) // @Data // public class Ephemeral { // // /** // * The type of this ephemeral // */ // @Setter(AccessLevel.PROTECTED) // private EphemeralType type; // // /** // * The identity of the user this ephemeral came from // */ // @SerializedName("source_user_iden") // private String sourceUserIdentity; // // public enum EphemeralType { // // /** // * Used for SMS replies // */ // @SerializedName("messaging_extension_reply") // SMS_REPLY, // // /** // * Used for universal copy paste // */ // @SerializedName("clip") // CLIP, // // /** // * Used for notification mirroring // */ // @SerializedName("mirror") // NOTIFICATION, // // /** // * Used for notification dismissal // */ // @SerializedName("dismissal") // DISMISSAL; // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/stream/message/PushStreamMessage.java import com.github.sheigutn.pushbullet.ephemeral.Ephemeral; import lombok.Data; import lombok.ToString; import java.util.List; package com.github.sheigutn.pushbullet.stream.message; @Data @ToString(callSuper = true) public class PushStreamMessage extends StreamMessage { public PushStreamMessage() { setType(StreamMessageType.PUSH); } /** * The ephemeral that has been transferred with this message */
private Ephemeral push;
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListSubscriptionsRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls; import lombok.Data;
package com.github.sheigutn.pushbullet.http.defaults.get; @Data public class ListSubscriptionsRequest extends ListItemsRequest { public ListSubscriptionsRequest() {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListSubscriptionsRequest.java import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls; import lombok.Data; package com.github.sheigutn.pushbullet.http.defaults.get; @Data public class ListSubscriptionsRequest extends ListItemsRequest { public ListSubscriptionsRequest() {
super(Urls.SUBSCRIPTIONS);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificPushRequest extends DeleteRequest<Void> { public DeleteSpecificPushRequest(String pushIdentity) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificPushRequest extends DeleteRequest<Void> { public DeleteSpecificPushRequest(String pushIdentity) {
super(Urls.PUSHES + "/" + pushIdentity);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendPushToChannelRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.github.sheigutn.pushbullet.http.Urls; import com.google.gson.Gson; import lombok.Data; import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class SendPushToChannelRequest extends PostRequest<Void> {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendPushToChannelRequest.java import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.github.sheigutn.pushbullet.http.Urls; import com.google.gson.Gson; import lombok.Data; import org.apache.http.client.methods.HttpPost; package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class SendPushToChannelRequest extends PostRequest<Void> {
private SendablePush push;
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendPushToChannelRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.github.sheigutn.pushbullet.http.Urls; import com.google.gson.Gson; import lombok.Data; import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class SendPushToChannelRequest extends PostRequest<Void> { private SendablePush push; public SendPushToChannelRequest(SendablePush push) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendPushToChannelRequest.java import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import com.github.sheigutn.pushbullet.http.Urls; import com.google.gson.Gson; import lombok.Data; import org.apache.http.client.methods.HttpPost; package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class SendPushToChannelRequest extends PostRequest<Void> { private SendablePush push; public SendPushToChannelRequest(SendablePush push) {
super(Urls.PUSHES);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/AddressPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java // @Getter // @Setter(AccessLevel.PROTECTED) // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public class Push extends PushbulletObject implements Deletable, Dismissable { // // /** // * The type of the push // */ // private PushType type; // // /** // * Whether the push has already been dimissed // */ // private boolean dismissed; // // /** // * The direction the push was sent to // */ // private Direction direction; // // /** // * The name of the sender // */ // @SerializedName("sender_name") // private String senderName; // // /** // * The identity of the channel the push was sent to // */ // @SerializedName("channel_iden") // private String channelIdentity; // // /** // * The client's identity // */ // @SerializedName("client_iden") // private String clientIdentity; // // /** // * The identity of the device the push was sent to // */ // @SerializedName("target_device_iden") // private String targetDeviceIdentity; // // /** // * The sender's identity // */ // @SerializedName("sender_iden") // private String senderIdentity; // // /** // * The sender's email // */ // @SerializedName("sender_email") // private String senderEmail; // // /** // * The sender's normalized email // */ // @SerializedName("sender_email_normalized") // private String normalizedSenderEmail; // // /** // * The receiver's identity // */ // @SerializedName("receiver_iden") // private String receiverIdentity; // // /** // * The receiver's email // */ // @SerializedName("receiver_email") // private String receiverEmail; // // /** // * The receiver's normalized email // */ // @SerializedName("receiver_email_normalized") // private String normalizedReceiverEmail; // // /** // * The list of awake apps the push was sent to when it was created // */ // @SerializedName("awake_app_guids") // private List<String> awakeAppGuids; // // /** // * A unique identifier for the push, set by the client // */ // private String guid; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); // getPushbullet().executeRequest(deleteSpecificPushRequest); // setActive(false); // } // // /** // * Show the push again if it was already dismissed // */ // public void show() { // if(!isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false)); // setDismissed(false); // } // // @Override // public void dismiss() { // if(isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true)); // setDismissed(true); // } // // /** // * Get the title of this push // * @return The title of this push // */ // public String getTitle() { // return null; // } // // /** // * Get the body of this push // * @return The body of this push // */ // public String getBody() { // return null; // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sent.Push; import lombok.Getter; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.push.sent.defaults; @Getter @ToString(callSuper = true) @Deprecated
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java // @Getter // @Setter(AccessLevel.PROTECTED) // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public class Push extends PushbulletObject implements Deletable, Dismissable { // // /** // * The type of the push // */ // private PushType type; // // /** // * Whether the push has already been dimissed // */ // private boolean dismissed; // // /** // * The direction the push was sent to // */ // private Direction direction; // // /** // * The name of the sender // */ // @SerializedName("sender_name") // private String senderName; // // /** // * The identity of the channel the push was sent to // */ // @SerializedName("channel_iden") // private String channelIdentity; // // /** // * The client's identity // */ // @SerializedName("client_iden") // private String clientIdentity; // // /** // * The identity of the device the push was sent to // */ // @SerializedName("target_device_iden") // private String targetDeviceIdentity; // // /** // * The sender's identity // */ // @SerializedName("sender_iden") // private String senderIdentity; // // /** // * The sender's email // */ // @SerializedName("sender_email") // private String senderEmail; // // /** // * The sender's normalized email // */ // @SerializedName("sender_email_normalized") // private String normalizedSenderEmail; // // /** // * The receiver's identity // */ // @SerializedName("receiver_iden") // private String receiverIdentity; // // /** // * The receiver's email // */ // @SerializedName("receiver_email") // private String receiverEmail; // // /** // * The receiver's normalized email // */ // @SerializedName("receiver_email_normalized") // private String normalizedReceiverEmail; // // /** // * The list of awake apps the push was sent to when it was created // */ // @SerializedName("awake_app_guids") // private List<String> awakeAppGuids; // // /** // * A unique identifier for the push, set by the client // */ // private String guid; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); // getPushbullet().executeRequest(deleteSpecificPushRequest); // setActive(false); // } // // /** // * Show the push again if it was already dismissed // */ // public void show() { // if(!isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false)); // setDismissed(false); // } // // @Override // public void dismiss() { // if(isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true)); // setDismissed(true); // } // // /** // * Get the title of this push // * @return The title of this push // */ // public String getTitle() { // return null; // } // // /** // * Get the body of this push // * @return The body of this push // */ // public String getBody() { // return null; // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/AddressPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sent.Push; import lombok.Getter; import lombok.ToString; package com.github.sheigutn.pushbullet.items.push.sent.defaults; @Getter @ToString(callSuper = true) @Deprecated
public class AddressPush extends Push {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/AddressPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java // @Getter // @Setter(AccessLevel.PROTECTED) // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public class Push extends PushbulletObject implements Deletable, Dismissable { // // /** // * The type of the push // */ // private PushType type; // // /** // * Whether the push has already been dimissed // */ // private boolean dismissed; // // /** // * The direction the push was sent to // */ // private Direction direction; // // /** // * The name of the sender // */ // @SerializedName("sender_name") // private String senderName; // // /** // * The identity of the channel the push was sent to // */ // @SerializedName("channel_iden") // private String channelIdentity; // // /** // * The client's identity // */ // @SerializedName("client_iden") // private String clientIdentity; // // /** // * The identity of the device the push was sent to // */ // @SerializedName("target_device_iden") // private String targetDeviceIdentity; // // /** // * The sender's identity // */ // @SerializedName("sender_iden") // private String senderIdentity; // // /** // * The sender's email // */ // @SerializedName("sender_email") // private String senderEmail; // // /** // * The sender's normalized email // */ // @SerializedName("sender_email_normalized") // private String normalizedSenderEmail; // // /** // * The receiver's identity // */ // @SerializedName("receiver_iden") // private String receiverIdentity; // // /** // * The receiver's email // */ // @SerializedName("receiver_email") // private String receiverEmail; // // /** // * The receiver's normalized email // */ // @SerializedName("receiver_email_normalized") // private String normalizedReceiverEmail; // // /** // * The list of awake apps the push was sent to when it was created // */ // @SerializedName("awake_app_guids") // private List<String> awakeAppGuids; // // /** // * A unique identifier for the push, set by the client // */ // private String guid; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); // getPushbullet().executeRequest(deleteSpecificPushRequest); // setActive(false); // } // // /** // * Show the push again if it was already dismissed // */ // public void show() { // if(!isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false)); // setDismissed(false); // } // // @Override // public void dismiss() { // if(isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true)); // setDismissed(true); // } // // /** // * Get the title of this push // * @return The title of this push // */ // public String getTitle() { // return null; // } // // /** // * Get the body of this push // * @return The body of this push // */ // public String getBody() { // return null; // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sent.Push; import lombok.Getter; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.push.sent.defaults; @Getter @ToString(callSuper = true) @Deprecated public class AddressPush extends Push { private AddressPush() {
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java // @Getter // @Setter(AccessLevel.PROTECTED) // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public class Push extends PushbulletObject implements Deletable, Dismissable { // // /** // * The type of the push // */ // private PushType type; // // /** // * Whether the push has already been dimissed // */ // private boolean dismissed; // // /** // * The direction the push was sent to // */ // private Direction direction; // // /** // * The name of the sender // */ // @SerializedName("sender_name") // private String senderName; // // /** // * The identity of the channel the push was sent to // */ // @SerializedName("channel_iden") // private String channelIdentity; // // /** // * The client's identity // */ // @SerializedName("client_iden") // private String clientIdentity; // // /** // * The identity of the device the push was sent to // */ // @SerializedName("target_device_iden") // private String targetDeviceIdentity; // // /** // * The sender's identity // */ // @SerializedName("sender_iden") // private String senderIdentity; // // /** // * The sender's email // */ // @SerializedName("sender_email") // private String senderEmail; // // /** // * The sender's normalized email // */ // @SerializedName("sender_email_normalized") // private String normalizedSenderEmail; // // /** // * The receiver's identity // */ // @SerializedName("receiver_iden") // private String receiverIdentity; // // /** // * The receiver's email // */ // @SerializedName("receiver_email") // private String receiverEmail; // // /** // * The receiver's normalized email // */ // @SerializedName("receiver_email_normalized") // private String normalizedReceiverEmail; // // /** // * The list of awake apps the push was sent to when it was created // */ // @SerializedName("awake_app_guids") // private List<String> awakeAppGuids; // // /** // * A unique identifier for the push, set by the client // */ // private String guid; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); // getPushbullet().executeRequest(deleteSpecificPushRequest); // setActive(false); // } // // /** // * Show the push again if it was already dismissed // */ // public void show() { // if(!isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false)); // setDismissed(false); // } // // @Override // public void dismiss() { // if(isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true)); // setDismissed(true); // } // // /** // * Get the title of this push // * @return The title of this push // */ // public String getTitle() { // return null; // } // // /** // * Get the body of this push // * @return The body of this push // */ // public String getBody() { // return null; // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/AddressPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sent.Push; import lombok.Getter; import lombok.ToString; package com.github.sheigutn.pushbullet.items.push.sent.defaults; @Getter @ToString(callSuper = true) @Deprecated public class AddressPush extends Push { private AddressPush() {
setType(PushType.ADDRESS);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateChatMuteStatusRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/chat/Chat.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Chat extends PushbulletObject implements Deletable, Mutable, Pushable, Blockable { // // /** // * The user this chat is held with // */ // private ChatUser with; // // /** // * Whether this chat is muted // */ // private boolean muted; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificChatRequest chatRequest = new DeleteSpecificChatRequest(getIdentity()); // getPushbullet().executeRequest(chatRequest); // setActive(false); // } // // public void mute() { // updateMute(true); // } // // public void unmute() { // updateMute(false); // } // // /** // * Used to block the user this chat is held with // */ // @Override // public void block() { // if(!isActive()) return; // getPushbullet().executeRequest(new BlockUserRequest(getWith().getEmail())); // setActive(false); // } // // private void updateMute(boolean muteStatus) { // getPushbullet().executeRequest(new UpdateChatMuteStatusRequest(getIdentity(), muteStatus)); // muted = muteStatus; // } // // @Override // public Push push(SendablePush push) { // return with.push(push); // } // }
import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.chat.Chat; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post; public class UpdateChatMuteStatusRequest extends PostRequest<Chat> { @SerializedName("muted") private boolean mute; public UpdateChatMuteStatusRequest(String chatIdentity, boolean mute) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/chat/Chat.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Chat extends PushbulletObject implements Deletable, Mutable, Pushable, Blockable { // // /** // * The user this chat is held with // */ // private ChatUser with; // // /** // * Whether this chat is muted // */ // private boolean muted; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificChatRequest chatRequest = new DeleteSpecificChatRequest(getIdentity()); // getPushbullet().executeRequest(chatRequest); // setActive(false); // } // // public void mute() { // updateMute(true); // } // // public void unmute() { // updateMute(false); // } // // /** // * Used to block the user this chat is held with // */ // @Override // public void block() { // if(!isActive()) return; // getPushbullet().executeRequest(new BlockUserRequest(getWith().getEmail())); // setActive(false); // } // // private void updateMute(boolean muteStatus) { // getPushbullet().executeRequest(new UpdateChatMuteStatusRequest(getIdentity(), muteStatus)); // muted = muteStatus; // } // // @Override // public Push push(SendablePush push) { // return with.push(push); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateChatMuteStatusRequest.java import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.chat.Chat; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import org.apache.http.client.methods.HttpPost; package com.github.sheigutn.pushbullet.http.defaults.post; public class UpdateChatMuteStatusRequest extends PostRequest<Chat> { @SerializedName("muted") private boolean mute; public UpdateChatMuteStatusRequest(String chatIdentity, boolean mute) {
super(Urls.CHATS + "/" + chatIdentity);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableNotePush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true)
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableNotePush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true)
public class SendableNotePush extends SendablePush {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableNotePush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableNotePush extends SendablePush { /** * The title for this push */ private String title; /** * The body for this push */ private String body; public SendableNotePush() {
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableNotePush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) public class SendableNotePush extends SendablePush { /** * The title for this push */ private String title; /** * The body for this push */ private String body; public SendableNotePush() {
super(PushType.NOTE);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableAddressPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableAddressPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated
public class SendableAddressPush extends SendablePush {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableAddressPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated public class SendableAddressPush extends SendablePush { /** * The name of the address */ private String name; /** * The address */ private String address; public SendableAddressPush() {
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableAddressPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated public class SendableAddressPush extends SendablePush { /** * The name of the address */ private String name; /** * The address */ private String address; public SendableAddressPush() {
super(PushType.ADDRESS);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Block extends PushbulletObject implements Deletable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Block extends PushbulletObject implements Deletable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Block extends PushbulletObject implements Deletable {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Block extends PushbulletObject implements Deletable {
private BlockedUser user;
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Block extends PushbulletObject implements Deletable { private BlockedUser user; @Override public void delete() { if(!isActive()) return;
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java // public class DeleteSpecificBlockRequest extends DeleteRequest<Void> { // // public DeleteSpecificBlockRequest(String blockIdentity) { // super(Urls.BLOCKS + "/" + blockIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class BlockedUser extends PushbulletIdentifiable { // // /** // * The email of this user // */ // private String email; // // /** // * The normalized email of this user // */ // @SerializedName("email_normalized") // private String normalizedEmail; // // /** // * The name of this user // */ // private String name; // // /** // * The url to the image of this user // */ // @SerializedName("image_url") // private String imageUrl; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/block/Block.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificBlockRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.items.user.BlockedUser; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.block; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Block extends PushbulletObject implements Deletable { private BlockedUser user; @Override public void delete() { if(!isActive()) return;
getPushbullet().executeRequest(new DeleteSpecificBlockRequest(getIdentity()));
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ChannelInfoRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java // @Getter // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class ChannelInfo extends PushbulletIdentifiable implements Subscribable { // // /** // * The tag of this channel // */ // private String tag; // // /** // * The name of this channel // */ // private String name; // // /** // * The description of this channel // */ // private String description; // // /** // * The url to the image of this channel // */ // @SerializedName("image_url") // private String imageUrl; // // /** // * The url to the website of this channel // */ // @SerializedName("website_url") // private String websiteUrl; // // /** // * The subscriber count of this channel // */ // @SerializedName("subscriber_count") // private int subscriberCount; // // /** // * The recent pushes of this channel // */ // @SerializedName("recent_pushes") // private List<Push> recentPushes; // // public void subscribe() { // getPushbullet().executeRequest(new SubscribeToChannelRequest(tag)); // subscriberCount++; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.GetRequest; import com.github.sheigutn.pushbullet.items.channel.ChannelInfo; import com.github.sheigutn.pushbullet.http.Urls; import lombok.Data; import org.apache.http.client.utils.URIBuilder;
package com.github.sheigutn.pushbullet.http.defaults.get; @Data public class ChannelInfoRequest extends GetRequest<ChannelInfo> { private String channelTag; private boolean noRecentPushes; public ChannelInfoRequest(String channelTag, boolean noRecentPushes) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java // @Getter // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class ChannelInfo extends PushbulletIdentifiable implements Subscribable { // // /** // * The tag of this channel // */ // private String tag; // // /** // * The name of this channel // */ // private String name; // // /** // * The description of this channel // */ // private String description; // // /** // * The url to the image of this channel // */ // @SerializedName("image_url") // private String imageUrl; // // /** // * The url to the website of this channel // */ // @SerializedName("website_url") // private String websiteUrl; // // /** // * The subscriber count of this channel // */ // @SerializedName("subscriber_count") // private int subscriberCount; // // /** // * The recent pushes of this channel // */ // @SerializedName("recent_pushes") // private List<Push> recentPushes; // // public void subscribe() { // getPushbullet().executeRequest(new SubscribeToChannelRequest(tag)); // subscriberCount++; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ChannelInfoRequest.java import com.github.sheigutn.pushbullet.http.GetRequest; import com.github.sheigutn.pushbullet.items.channel.ChannelInfo; import com.github.sheigutn.pushbullet.http.Urls; import lombok.Data; import org.apache.http.client.utils.URIBuilder; package com.github.sheigutn.pushbullet.http.defaults.get; @Data public class ChannelInfoRequest extends GetRequest<ChannelInfo> { private String channelTag; private boolean noRecentPushes; public ChannelInfoRequest(String channelTag, boolean noRecentPushes) {
super(Urls.CHANNEL_INFO);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java // @Getter // @Setter(AccessLevel.PROTECTED) // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public class Push extends PushbulletObject implements Deletable, Dismissable { // // /** // * The type of the push // */ // private PushType type; // // /** // * Whether the push has already been dimissed // */ // private boolean dismissed; // // /** // * The direction the push was sent to // */ // private Direction direction; // // /** // * The name of the sender // */ // @SerializedName("sender_name") // private String senderName; // // /** // * The identity of the channel the push was sent to // */ // @SerializedName("channel_iden") // private String channelIdentity; // // /** // * The client's identity // */ // @SerializedName("client_iden") // private String clientIdentity; // // /** // * The identity of the device the push was sent to // */ // @SerializedName("target_device_iden") // private String targetDeviceIdentity; // // /** // * The sender's identity // */ // @SerializedName("sender_iden") // private String senderIdentity; // // /** // * The sender's email // */ // @SerializedName("sender_email") // private String senderEmail; // // /** // * The sender's normalized email // */ // @SerializedName("sender_email_normalized") // private String normalizedSenderEmail; // // /** // * The receiver's identity // */ // @SerializedName("receiver_iden") // private String receiverIdentity; // // /** // * The receiver's email // */ // @SerializedName("receiver_email") // private String receiverEmail; // // /** // * The receiver's normalized email // */ // @SerializedName("receiver_email_normalized") // private String normalizedReceiverEmail; // // /** // * The list of awake apps the push was sent to when it was created // */ // @SerializedName("awake_app_guids") // private List<String> awakeAppGuids; // // /** // * A unique identifier for the push, set by the client // */ // private String guid; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); // getPushbullet().executeRequest(deleteSpecificPushRequest); // setActive(false); // } // // /** // * Show the push again if it was already dismissed // */ // public void show() { // if(!isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false)); // setDismissed(false); // } // // @Override // public void dismiss() { // if(isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true)); // setDismissed(true); // } // // /** // * Get the title of this push // * @return The title of this push // */ // public String getTitle() { // return null; // } // // /** // * Get the body of this push // * @return The body of this push // */ // public String getBody() { // return null; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.items.push.sent.Push; import com.github.sheigutn.pushbullet.http.Urls; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post; public class ChangePushDismissStatusRequest extends PostRequest<Push> { @SerializedName("dismissed") private boolean dismiss; public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java // @Getter // @Setter(AccessLevel.PROTECTED) // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PROTECTED) // public class Push extends PushbulletObject implements Deletable, Dismissable { // // /** // * The type of the push // */ // private PushType type; // // /** // * Whether the push has already been dimissed // */ // private boolean dismissed; // // /** // * The direction the push was sent to // */ // private Direction direction; // // /** // * The name of the sender // */ // @SerializedName("sender_name") // private String senderName; // // /** // * The identity of the channel the push was sent to // */ // @SerializedName("channel_iden") // private String channelIdentity; // // /** // * The client's identity // */ // @SerializedName("client_iden") // private String clientIdentity; // // /** // * The identity of the device the push was sent to // */ // @SerializedName("target_device_iden") // private String targetDeviceIdentity; // // /** // * The sender's identity // */ // @SerializedName("sender_iden") // private String senderIdentity; // // /** // * The sender's email // */ // @SerializedName("sender_email") // private String senderEmail; // // /** // * The sender's normalized email // */ // @SerializedName("sender_email_normalized") // private String normalizedSenderEmail; // // /** // * The receiver's identity // */ // @SerializedName("receiver_iden") // private String receiverIdentity; // // /** // * The receiver's email // */ // @SerializedName("receiver_email") // private String receiverEmail; // // /** // * The receiver's normalized email // */ // @SerializedName("receiver_email_normalized") // private String normalizedReceiverEmail; // // /** // * The list of awake apps the push was sent to when it was created // */ // @SerializedName("awake_app_guids") // private List<String> awakeAppGuids; // // /** // * A unique identifier for the push, set by the client // */ // private String guid; // // @Override // public void delete() { // if(!isActive()) return; // DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); // getPushbullet().executeRequest(deleteSpecificPushRequest); // setActive(false); // } // // /** // * Show the push again if it was already dismissed // */ // public void show() { // if(!isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false)); // setDismissed(false); // } // // @Override // public void dismiss() { // if(isDismissed()) return; // getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true)); // setDismissed(true); // } // // /** // * Get the title of this push // * @return The title of this push // */ // public String getTitle() { // return null; // } // // /** // * Get the body of this push // * @return The body of this push // */ // public String getBody() { // return null; // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.items.push.sent.Push; import com.github.sheigutn.pushbullet.http.Urls; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import org.apache.http.client.methods.HttpPost; package com.github.sheigutn.pushbullet.http.defaults.post; public class ChangePushDismissStatusRequest extends PostRequest<Push> { @SerializedName("dismissed") private boolean dismiss; public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) {
super(Urls.PUSHES + "/" + pushIdentity);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { // // /** // * The channel info of this subscription // */ // private ChannelInfo channel; // // /** // * Whether this subscription is muted // */ // private boolean muted; // // @Override // public void unsubscribe() { // if(!isActive()) return; // getPushbullet().executeRequest(new DeleteSpecificSubscriptionRequest(getIdentity())); // setActive(false); // } // // @Override // public void delete() { // unsubscribe(); // } // // public void mute() { // updateMute(true); // } // // public void unmute() { // updateMute(false); // } // // private void updateMute(boolean muteStatus) { // getPushbullet().executeRequest(new UpdateSubscriptionMuteStatusRequest(getIdentity(), muteStatus)); // muted = muteStatus; // } // }
import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.channel.Subscription; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import lombok.Data; import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { @SerializedName("muted") private boolean mute; public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { // // /** // * The channel info of this subscription // */ // private ChannelInfo channel; // // /** // * Whether this subscription is muted // */ // private boolean muted; // // @Override // public void unsubscribe() { // if(!isActive()) return; // getPushbullet().executeRequest(new DeleteSpecificSubscriptionRequest(getIdentity())); // setActive(false); // } // // @Override // public void delete() { // unsubscribe(); // } // // public void mute() { // updateMute(true); // } // // public void unmute() { // updateMute(false); // } // // private void updateMute(boolean muteStatus) { // getPushbullet().executeRequest(new UpdateSubscriptionMuteStatusRequest(getIdentity(), muteStatus)); // muted = muteStatus; // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.channel.Subscription; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import lombok.Data; import org.apache.http.client.methods.HttpPost; package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { @SerializedName("muted") private boolean mute; public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) {
super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { /** * The channel info of this subscription */ private ChannelInfo channel; /** * Whether this subscription is muted */ private boolean muted; @Override public void unsubscribe() { if(!isActive()) return;
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { /** * The channel info of this subscription */ private ChannelInfo channel; /** * Whether this subscription is muted */ private boolean muted; @Override public void unsubscribe() { if(!isActive()) return;
getPushbullet().executeRequest(new DeleteSpecificSubscriptionRequest(getIdentity()));
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { /** * The channel info of this subscription */ private ChannelInfo channel; /** * Whether this subscription is muted */ private boolean muted; @Override public void unsubscribe() { if(!isActive()) return; getPushbullet().executeRequest(new DeleteSpecificSubscriptionRequest(getIdentity())); setActive(false); } @Override public void delete() { unsubscribe(); } public void mute() { updateMute(true); } public void unmute() { updateMute(false); } private void updateMute(boolean muteStatus) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java // public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> { // // public DeleteSpecificSubscriptionRequest(String channelIdentity) { // super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Unsubscribable.java // public interface Unsubscribable { // // /** // * Used to unsubscribe of this object // */ // void unsubscribe(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateSubscriptionMuteStatusRequest.java // @Data // public class UpdateSubscriptionMuteStatusRequest extends PostRequest<Subscription> { // // @SerializedName("muted") // private boolean mute; // // public UpdateSubscriptionMuteStatusRequest(String subscriptionIdentity, boolean mute) { // super(Urls.SUBSCRIPTIONS + "/" + subscriptionIdentity); // this.mute = mute; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Mutable.java // public interface Mutable { // // /** // * Used to mute this object // */ // void mute(); // // /** // * Used to unmute this object // */ // void unmute(); // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificSubscriptionRequest; import com.github.sheigutn.pushbullet.interfaces.Unsubscribable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.http.defaults.post.UpdateSubscriptionMuteStatusRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Mutable; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.channel; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { /** * The channel info of this subscription */ private ChannelInfo channel; /** * Whether this subscription is muted */ private boolean muted; @Override public void unsubscribe() { if(!isActive()) return; getPushbullet().executeRequest(new DeleteSpecificSubscriptionRequest(getIdentity())); setActive(false); } @Override public void delete() { unsubscribe(); } public void mute() { updateMute(true); } public void unmute() { updateMute(false); } private void updateMute(boolean muteStatus) {
getPushbullet().executeRequest(new UpdateSubscriptionMuteStatusRequest(getIdentity(), muteStatus));
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificChannelRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificChannelRequest extends DeleteRequest<Void> { public DeleteSpecificChannelRequest(String channelIdentity) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificChannelRequest.java import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificChannelRequest extends DeleteRequest<Void> { public DeleteSpecificChannelRequest(String channelIdentity) {
super(Urls.CHANNELS + "/" + channelIdentity);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { public DeleteSpecificAccountRequest(String accountIdentity) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java import com.github.sheigutn.pushbullet.http.DeleteRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { public DeleteSpecificAccountRequest(String accountIdentity) {
super(Urls.ACCOUNTS + "/" + accountIdentity);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/oauth/OAuthClient.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java // public class DeleteSpecificClientRequest extends DeleteRequest<Void> { // // public DeleteSpecificClientRequest(String clientIdentity) { // super(Urls.CLIENTS + "/" + clientIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificClientRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.oauth; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java // public class DeleteSpecificClientRequest extends DeleteRequest<Void> { // // public DeleteSpecificClientRequest(String clientIdentity) { // super(Urls.CLIENTS + "/" + clientIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/oauth/OAuthClient.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificClientRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.oauth; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class OAuthClient extends PushbulletObject implements Deletable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/oauth/OAuthClient.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java // public class DeleteSpecificClientRequest extends DeleteRequest<Void> { // // public DeleteSpecificClientRequest(String clientIdentity) { // super(Urls.CLIENTS + "/" + clientIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificClientRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.oauth; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java // public class DeleteSpecificClientRequest extends DeleteRequest<Void> { // // public DeleteSpecificClientRequest(String clientIdentity) { // super(Urls.CLIENTS + "/" + clientIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/oauth/OAuthClient.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificClientRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.oauth; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class OAuthClient extends PushbulletObject implements Deletable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/oauth/OAuthClient.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java // public class DeleteSpecificClientRequest extends DeleteRequest<Void> { // // public DeleteSpecificClientRequest(String clientIdentity) { // super(Urls.CLIENTS + "/" + clientIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificClientRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.oauth; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class OAuthClient extends PushbulletObject implements Deletable { /** * The name of this client */ private String name; /** * The url to the image of this client */ @SerializedName("image_url") private String imageUrl; /** * The url to the website of this client */ @SerializedName("website_url") private String websiteUrl; /** * The uri users should be redirected to */ @SerializedName("redirect_uri") private String redirectUri; /** * The id of this client */ @SerializedName("client_id") private String clientId; /** * The secret of this client */ @SerializedName("client_secret") private String clientSecret; /** * The allowed origin of this client */ @SerializedName("allowed_origin") private String allowedOrigin; @Override public void delete() { if(!isActive()) return;
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java // public class DeleteSpecificClientRequest extends DeleteRequest<Void> { // // public DeleteSpecificClientRequest(String clientIdentity) { // super(Urls.CLIENTS + "/" + clientIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/oauth/OAuthClient.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificClientRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.oauth; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class OAuthClient extends PushbulletObject implements Deletable { /** * The name of this client */ private String name; /** * The url to the image of this client */ @SerializedName("image_url") private String imageUrl; /** * The url to the website of this client */ @SerializedName("website_url") private String websiteUrl; /** * The uri users should be redirected to */ @SerializedName("redirect_uri") private String redirectUri; /** * The id of this client */ @SerializedName("client_id") private String clientId; /** * The secret of this client */ @SerializedName("client_secret") private String clientSecret; /** * The allowed origin of this client */ @SerializedName("allowed_origin") private String allowedOrigin; @Override public void delete() { if(!isActive()) return;
getPushbullet().executeRequest(new DeleteSpecificClientRequest(getIdentity()));
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/CurrentUserInfoRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/CurrentUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class CurrentUser extends User { // // /** // * The google user info of this user // */ // @SerializedName("google_userinfo") // private GoogleUserInfo googleUserInfo; // // /** // * The preferences of this user // */ // private JsonObject preferences; // // /** // * The maximum allowed upload size for files allowed to this user // */ // @SerializedName("max_upload_size") // private long maxUploadSize; // // /** // * Used to update the preferences of this user // * @param preferences The preferences object // */ // public void updatePreferences(JsonObject preferences) { // getPushbullet().executeRequest(new UpdatePreferencesRequest(preferences)); // this.preferences = preferences; // } // // @Override // public void block() { // throw new UnsupportedOperationException(); // } // // @Getter // public class GoogleUserInfo { // // /** // * The google name of this user // */ // private String name; // } // }
import com.github.sheigutn.pushbullet.http.GetRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.user.CurrentUser;
package com.github.sheigutn.pushbullet.http.defaults.get; public class CurrentUserInfoRequest extends GetRequest<CurrentUser> { public CurrentUserInfoRequest() {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java // public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> { // // public GetRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/CurrentUser.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class CurrentUser extends User { // // /** // * The google user info of this user // */ // @SerializedName("google_userinfo") // private GoogleUserInfo googleUserInfo; // // /** // * The preferences of this user // */ // private JsonObject preferences; // // /** // * The maximum allowed upload size for files allowed to this user // */ // @SerializedName("max_upload_size") // private long maxUploadSize; // // /** // * Used to update the preferences of this user // * @param preferences The preferences object // */ // public void updatePreferences(JsonObject preferences) { // getPushbullet().executeRequest(new UpdatePreferencesRequest(preferences)); // this.preferences = preferences; // } // // @Override // public void block() { // throw new UnsupportedOperationException(); // } // // @Getter // public class GoogleUserInfo { // // /** // * The google name of this user // */ // private String name; // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/CurrentUserInfoRequest.java import com.github.sheigutn.pushbullet.http.GetRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.user.CurrentUser; package com.github.sheigutn.pushbullet.http.defaults.get; public class CurrentUserInfoRequest extends GetRequest<CurrentUser> { public CurrentUserInfoRequest() {
super(Urls.CURRENT_USER);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java // @Data // public abstract class PushbulletIdentifiable extends PushbulletContainer { // // /** // * The identity of this object // */ // @SerializedName("iden") // private String identity; // }
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.user; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java // @Data // public abstract class PushbulletIdentifiable extends PushbulletContainer { // // /** // * The identity of this object // */ // @SerializedName("iden") // private String identity; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/user/BlockedUser.java import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.user; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class BlockedUser extends PushbulletIdentifiable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableListPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableListPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; import java.util.List; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated
public class SendableListPush extends SendablePush {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableListPush.java
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // }
import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated public class SendableListPush extends SendablePush { /** * The title for this push */ private String title; /** * The list items for this push */ private List<String> items; public SendableListPush() {
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java // @Accessors(chain = true) // @Data // public abstract class SendablePush implements Cloneable { // // private final PushType type; // // /** // * The identity of the device the push should be sent to // */ // @SerializedName("device_iden") // @Setter(AccessLevel.NONE) // private String deviceIdentity; // // /** // * The email of the user the push should be sent to // */ // @SerializedName("email") // @Setter(AccessLevel.NONE) // private String email; // // /** // * The tag of the channel the push should be sent to // */ // @SerializedName("channel_tag") // @Setter(AccessLevel.NONE) // private String channelTag; // // /** // * The identity of the oauth client the push should be sent to // */ // @SerializedName("client_iden") // @Setter(AccessLevel.NONE) // private String clientIdentity; // // /** // * A unique identifier for this push // */ // private String guid; // // /** // * Used to set a receiver for this push // * @param type The type of receiver this push should be sent to // * @param value The channel tag / email / client identity or device identity // * @return The object the method was executed on // */ // public SendablePush setReceiver(ReceiverType type, String value) { // clearReceivers(); // switch (type) { // case DEVICE: // deviceIdentity = value; // break; // case EMAIL: // email = value; // break; // case CHANNEL: // channelTag = value; // break; // case OAUTH_CLIENT: // clientIdentity = value; // break; // } // return this; // } // // /** // * Used to clear all receivers of this push // */ // public void clearReceivers() { // this.deviceIdentity = null; // this.email = null; // this.channelTag = null; // this.clientIdentity = null; // } // // /** // * Clone this push // * @return A clone of this object // */ // @Override // @SneakyThrows // public SendablePush clone() { // return (SendablePush) super.clone(); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/defaults/SendableListPush.java import com.github.sheigutn.pushbullet.items.push.PushType; import com.github.sheigutn.pushbullet.items.push.sendable.SendablePush; import lombok.Data; import lombok.ToString; import lombok.experimental.Accessors; import java.util.List; package com.github.sheigutn.pushbullet.items.push.sendable.defaults; @Accessors(chain = true) @Data @ToString(callSuper = true) @Deprecated public class SendableListPush extends SendablePush { /** * The title for this push */ private String title; /** * The list items for this push */ private List<String> items; public SendableListPush() {
super(PushType.LIST);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { // // /** // * The channel info of this subscription // */ // private ChannelInfo channel; // // /** // * Whether this subscription is muted // */ // private boolean muted; // // @Override // public void unsubscribe() { // if(!isActive()) return; // getPushbullet().executeRequest(new DeleteSpecificSubscriptionRequest(getIdentity())); // setActive(false); // } // // @Override // public void delete() { // unsubscribe(); // } // // public void mute() { // updateMute(true); // } // // public void unmute() { // updateMute(false); // } // // private void updateMute(boolean muteStatus) { // getPushbullet().executeRequest(new UpdateSubscriptionMuteStatusRequest(getIdentity(), muteStatus)); // muted = muteStatus; // } // }
import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.channel.Subscription; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import lombok.Data; import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class SubscribeToChannelRequest extends PostRequest<Subscription> { @SerializedName("channel_tag") private String channelTag; public SubscribeToChannelRequest(String channelTag) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java // public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> { // // public PostRequest(String relativePath) { // super(relativePath); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/Subscription.java // @Getter // @ToString(callSuper = true) // @NoArgsConstructor(access = AccessLevel.PRIVATE) // public class Subscription extends PushbulletObject implements Deletable, Mutable, Unsubscribable { // // /** // * The channel info of this subscription // */ // private ChannelInfo channel; // // /** // * Whether this subscription is muted // */ // private boolean muted; // // @Override // public void unsubscribe() { // if(!isActive()) return; // getPushbullet().executeRequest(new DeleteSpecificSubscriptionRequest(getIdentity())); // setActive(false); // } // // @Override // public void delete() { // unsubscribe(); // } // // public void mute() { // updateMute(true); // } // // public void unmute() { // updateMute(false); // } // // private void updateMute(boolean muteStatus) { // getPushbullet().executeRequest(new UpdateSubscriptionMuteStatusRequest(getIdentity(), muteStatus)); // muted = muteStatus; // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java import com.github.sheigutn.pushbullet.http.PostRequest; import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.items.channel.Subscription; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import lombok.Data; import org.apache.http.client.methods.HttpPost; package com.github.sheigutn.pushbullet.http.defaults.post; @Data public class SubscribeToChannelRequest extends PostRequest<Subscription> { @SerializedName("channel_tag") private String channelTag; public SubscribeToChannelRequest(String channelTag) {
super(Urls.SUBSCRIPTIONS);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // }
import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.http.DeleteRequest;
package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificGrantRequest extends DeleteRequest<Void> { public DeleteSpecificGrantRequest(String grantIdentity) {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java // public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> { // // public DeleteRequest(String relativePath) { // super(relativePath); // } // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java import com.github.sheigutn.pushbullet.http.Urls; import com.github.sheigutn.pushbullet.http.DeleteRequest; package com.github.sheigutn.pushbullet.http.defaults.delete; public class DeleteSpecificGrantRequest extends DeleteRequest<Void> { public DeleteSpecificGrantRequest(String grantIdentity) {
super(Urls.GRANTS + "/" + grantIdentity);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListClientsRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get; public class ListClientsRequest extends ListItemsRequest { public ListClientsRequest() {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListClientsRequest.java import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.get; public class ListClientsRequest extends ListItemsRequest { public ListClientsRequest() {
super(Urls.CLIENTS);
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List; package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Push extends PushbulletObject implements Deletable, Dismissable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List; package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Push extends PushbulletObject implements Deletable, Dismissable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List; package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Push extends PushbulletObject implements Deletable, Dismissable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Push extends PushbulletObject implements Deletable, Dismissable { /** * The type of the push */
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List; package com.github.sheigutn.pushbullet.items.push.sent; @Getter @Setter(AccessLevel.PROTECTED) @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Push extends PushbulletObject implements Deletable, Dismissable { /** * The type of the push */
private PushType type;
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List;
*/ @SerializedName("receiver_iden") private String receiverIdentity; /** * The receiver's email */ @SerializedName("receiver_email") private String receiverEmail; /** * The receiver's normalized email */ @SerializedName("receiver_email_normalized") private String normalizedReceiverEmail; /** * The list of awake apps the push was sent to when it was created */ @SerializedName("awake_app_guids") private List<String> awakeAppGuids; /** * A unique identifier for the push, set by the client */ private String guid; @Override public void delete() { if(!isActive()) return;
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List; */ @SerializedName("receiver_iden") private String receiverIdentity; /** * The receiver's email */ @SerializedName("receiver_email") private String receiverEmail; /** * The receiver's normalized email */ @SerializedName("receiver_email_normalized") private String normalizedReceiverEmail; /** * The list of awake apps the push was sent to when it was created */ @SerializedName("awake_app_guids") private List<String> awakeAppGuids; /** * A unique identifier for the push, set by the client */ private String guid; @Override public void delete() { if(!isActive()) return;
DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List;
/** * The receiver's normalized email */ @SerializedName("receiver_email_normalized") private String normalizedReceiverEmail; /** * The list of awake apps the push was sent to when it was created */ @SerializedName("awake_app_guids") private List<String> awakeAppGuids; /** * A unique identifier for the push, set by the client */ private String guid; @Override public void delete() { if(!isActive()) return; DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); getPushbullet().executeRequest(deleteSpecificPushRequest); setActive(false); } /** * Show the push again if it was already dismissed */ public void show() { if(!isDismissed()) return;
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificPushRequest.java // public class DeleteSpecificPushRequest extends DeleteRequest<Void> { // // public DeleteSpecificPushRequest(String pushIdentity) { // super(Urls.PUSHES + "/" + pushIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/ChangePushDismissStatusRequest.java // public class ChangePushDismissStatusRequest extends PostRequest<Push> { // // @SerializedName("dismissed") // private boolean dismiss; // // public ChangePushDismissStatusRequest(String pushIdentity, boolean dismiss) { // super(Urls.PUSHES + "/" + pushIdentity); // this.dismiss = dismiss; // } // // @Override // public void applyBody(Gson gson, HttpPost post) { // setJsonBody(gson.toJson(this), post); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Dismissable.java // @FunctionalInterface // public interface Dismissable { // // /** // * Dismiss the push if it is currently shown // */ // void dismiss(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java // public enum PushType { // // /** // * Used for note pushes // */ // @SerializedName("note") // NOTE, // // /** // * Used for link pushes // */ // @SerializedName("link") // LINK, // // /** // * Used for file pushes // */ // @SerializedName("file") // FILE, // // /** // * Used for list pushes // */ // @SerializedName("list") // LIST, // // /** // * Used for address pushes // */ // @SerializedName("address") // ADDRESS; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificPushRequest; import com.github.sheigutn.pushbullet.http.defaults.post.ChangePushDismissStatusRequest; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.interfaces.Dismissable; import com.github.sheigutn.pushbullet.items.push.PushType; import com.google.gson.annotations.SerializedName; import lombok.*; import java.util.List; /** * The receiver's normalized email */ @SerializedName("receiver_email_normalized") private String normalizedReceiverEmail; /** * The list of awake apps the push was sent to when it was created */ @SerializedName("awake_app_guids") private List<String> awakeAppGuids; /** * A unique identifier for the push, set by the client */ private String guid; @Override public void delete() { if(!isActive()) return; DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity()); getPushbullet().executeRequest(deleteSpecificPushRequest); setActive(false); } /** * Show the push again if it was already dismissed */ public void show() { if(!isDismissed()) return;
getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/account/Account.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java // public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { // // public DeleteSpecificAccountRequest(String accountIdentity) { // super(Urls.ACCOUNTS + "/" + accountIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificAccountRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.account; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java // public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { // // public DeleteSpecificAccountRequest(String accountIdentity) { // super(Urls.ACCOUNTS + "/" + accountIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/account/Account.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificAccountRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.account; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Account extends PushbulletObject implements Deletable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/account/Account.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java // public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { // // public DeleteSpecificAccountRequest(String accountIdentity) { // super(Urls.ACCOUNTS + "/" + accountIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificAccountRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.account; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java // public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { // // public DeleteSpecificAccountRequest(String accountIdentity) { // super(Urls.ACCOUNTS + "/" + accountIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/account/Account.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificAccountRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.account; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Account extends PushbulletObject implements Deletable {
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/items/account/Account.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java // public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { // // public DeleteSpecificAccountRequest(String accountIdentity) { // super(Urls.ACCOUNTS + "/" + accountIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // }
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificAccountRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString;
package com.github.sheigutn.pushbullet.items.account; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Account extends PushbulletObject implements Deletable { /** * The type of this account */ private String type; /** * The id of this account */ private String id; /** * The email of this account */ private String email; /** * The normalized email of this account */ @SerializedName("email_normalized") private String normalizedEmail; /** * The name of this account */ private String name; /** * The url to the image of this account */ @SerializedName("image_url") private String imageUrl; @Override public void delete() { if(!isActive()) return;
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificAccountRequest.java // public class DeleteSpecificAccountRequest extends DeleteRequest<Void> { // // public DeleteSpecificAccountRequest(String accountIdentity) { // super(Urls.ACCOUNTS + "/" + accountIdentity); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java // @FunctionalInterface // public interface Deletable { // // /** // * Used to delete this object // */ // void delete(); // } // // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java // @Data // public abstract class PushbulletObject extends PushbulletIdentifiable { // // /** // * Creation timestamp of this object // */ // private Number created; // // /** // * Last modification timestamp of this object // */ // private Number modified; // // /** // * Whether this object is active or not // */ // private boolean active = true; // } // Path: src/main/java/com/github/sheigutn/pushbullet/items/account/Account.java import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificAccountRequest; import com.github.sheigutn.pushbullet.interfaces.Deletable; import com.github.sheigutn.pushbullet.items.PushbulletObject; import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; package com.github.sheigutn.pushbullet.items.account; @Getter @ToString(callSuper = true) @NoArgsConstructor(access = AccessLevel.PRIVATE) public class Account extends PushbulletObject implements Deletable { /** * The type of this account */ private String type; /** * The id of this account */ private String id; /** * The email of this account */ private String email; /** * The normalized email of this account */ @SerializedName("email_normalized") private String normalizedEmail; /** * The name of this account */ private String name; /** * The url to the image of this account */ @SerializedName("image_url") private String imageUrl; @Override public void delete() { if(!isActive()) return;
getPushbullet().executeRequest(new DeleteSpecificAccountRequest(getIdentity()));
Sheigutn/pushbullet-java-8
src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListAccountsRequest.java
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // }
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get; public class ListAccountsRequest extends ListItemsRequest { public ListAccountsRequest() {
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java // @Accessors(chain = true) // @Data // public class ListItemsRequest extends GetRequest<ListResponse> { // // private Number modifiedAfter; // // private boolean onlyShowActiveItems = true; // // private String cursor; // // private Number limit; // // public ListItemsRequest(String relativePath) { // super(relativePath); // } // // @Override // public void applyParameters(URIBuilder builder) { // addParam("modified_after", modifiedAfter, builder); // addParam("active", onlyShowActiveItems, builder); // addParam("cursor", cursor, builder); // addParam("limit", limit, builder); // } // } // // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java // public class Urls { // // public static final String CHANNELS = "/channels"; // public static final String GRANTS = "/grants"; // public static final String PUSHES = "/pushes"; // public static final String SUBSCRIPTIONS = "/subscriptions"; // public static final String EVERYTHING = "/everything"; // public static final String PHONEBOOK = "/permanents/phonebook_"; // public static final String DEVICES = "/devices"; // public static final String CONTACTS = "/contacts"; // public static final String CLIENTS = "/clients"; // public static final String CHATS = "/chats"; // public static final String ACCOUNTS = "/accounts"; // public static final String CURRENT_USER = "/users/me"; // public static final String CHANNEL_INFO = "/channel-info"; // public static final String UPLOAD_REQUEST = "/upload-request"; // public static final String EPHEMERALS = "/ephemerals"; // public static final String BLOCKS = "/blocks"; // } // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListAccountsRequest.java import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; import com.github.sheigutn.pushbullet.http.Urls; package com.github.sheigutn.pushbullet.http.defaults.get; public class ListAccountsRequest extends ListItemsRequest { public ListAccountsRequest() {
super(Urls.ACCOUNTS);
Labs64/swid-generator
src/test/java/com/labs64/utils/swid/support/SwidUtilsTest.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import java.text.SimpleDateFormat; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import com.labs64.utils.swid.exception.SwidException; import static org.junit.Assert.assertEquals;
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.support; /** */ public class SwidUtilsTest { @BeforeClass public static void setup() { } @Before public void setUp() { } @Test public void testGenerateDomainDate() throws Exception { String date_s = "2010-04-13 01:02:03.0"; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); assertEquals("2010-04", SwidUtils.generateDomainDate(dateFormat.parse(date_s))); }
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/test/java/com/labs64/utils/swid/support/SwidUtilsTest.java import java.text.SimpleDateFormat; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import com.labs64.utils.swid.exception.SwidException; import static org.junit.Assert.assertEquals; /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.support; /** */ public class SwidUtilsTest { @BeforeClass public static void setup() { } @Before public void setUp() { } @Test public void testGenerateDomainDate() throws Exception { String date_s = "2010-04-13 01:02:03.0"; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); assertEquals("2010-04", SwidUtils.generateDomainDate(dateFormat.parse(date_s))); }
@Test(expected = SwidException.class)
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/builder/ResourceBuilder.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Resource;
package com.labs64.utils.swid.builder; public class ResourceBuilder extends BaseElementBuilder<Resource, ResourceBuilder> { /** * Sets the value of the type property. * * @param type * allowed object is * {@link String } * @return reference to this object */ public ResourceBuilder type(String type) { item.setType(type); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getType())) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/main/java/com/labs64/utils/swid/builder/ResourceBuilder.java import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Resource; package com.labs64.utils.swid.builder; public class ResourceBuilder extends BaseElementBuilder<Resource, ResourceBuilder> { /** * Sets the value of the type property. * * @param type * allowed object is * {@link String } * @return reference to this object */ public ResourceBuilder type(String type) { item.setType(type); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getType())) {
throw new SwidException("'resource.type' is not set");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/builder/EntityBuilder.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Entity; import org.iso.standards.iso._19770.__2._2014_dis.schema.Meta; import java.util.List;
* Adds a list of roles to the entity. * * @param role * allowed object is * {@link List<String> } * */ public EntityBuilder role(List<String> role) { if (role != null) { item.getRole().addAll(role); } return this; } /** * Sets the value of the thumbprint property. * * @param thumbprint * allowed object is * {@link String } * */ public EntityBuilder thumbprint(String thumbprint) { item.setThumbprint(thumbprint); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getName())) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/main/java/com/labs64/utils/swid/builder/EntityBuilder.java import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Entity; import org.iso.standards.iso._19770.__2._2014_dis.schema.Meta; import java.util.List; * Adds a list of roles to the entity. * * @param role * allowed object is * {@link List<String> } * */ public EntityBuilder role(List<String> role) { if (role != null) { item.getRole().addAll(role); } return this; } /** * Sets the value of the thumbprint property. * * @param thumbprint * allowed object is * {@link String } * */ public EntityBuilder thumbprint(String thumbprint) { item.setThumbprint(thumbprint); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getName())) {
throw new SwidException("'entity.name' is not set");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/builder/LinkBuilder.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Link; import org.iso.standards.iso._19770.__2._2014_dis.schema.Ownership; import org.iso.standards.iso._19770.__2._2014_dis.schema.Use;
} /** * Sets the value of the type property. * * @param type * allowed object is * {@link String } * */ public LinkBuilder type(String type) { item.setType(type); return this; } /** * Sets the value of the use property. * * @param use * allowed object is * {@link Use } * */ public LinkBuilder use(Use use) { item.setUse(use); return this; } protected void validate() { if (StringUtils.isBlank(item.getHref())) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/main/java/com/labs64/utils/swid/builder/LinkBuilder.java import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Link; import org.iso.standards.iso._19770.__2._2014_dis.schema.Ownership; import org.iso.standards.iso._19770.__2._2014_dis.schema.Use; } /** * Sets the value of the type property. * * @param type * allowed object is * {@link String } * */ public LinkBuilder type(String type) { item.setType(type); return this; } /** * Sets the value of the use property. * * @param use * allowed object is * {@link Use } * */ public LinkBuilder use(Use use) { item.setUse(use); return this; } protected void validate() { if (StringUtils.isBlank(item.getHref())) {
throw new SwidException("'link.href' is not set");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/builder/EvidenceBuilder.java
// Path: src/main/java/com/labs64/utils/swid/support/JAXBUtils.java // public static XMLGregorianCalendar convertDateToXMLGregorianCalendar(final Date date) { // try { // GregorianCalendar cal = new GregorianCalendar(); // cal.setTime(date); // XMLGregorianCalendar calXml = DatatypeFactory.newInstance().newXMLGregorianCalendar( // cal.get(Calendar.YEAR), // cal.get(Calendar.MONTH) + 1, // cal.get(Calendar.DAY_OF_MONTH), // cal.get(Calendar.HOUR_OF_DAY), // cal.get(Calendar.MINUTE), // cal.get(Calendar.SECOND), // cal.get(Calendar.MILLISECOND), // 0); // return calXml; // } catch (DatatypeConfigurationException e) { // throw new SwidException("Cannot convert date", e); // } // }
import org.iso.standards.iso._19770.__2._2014_dis.schema.Directory; import org.iso.standards.iso._19770.__2._2014_dis.schema.Evidence; import org.iso.standards.iso._19770.__2._2014_dis.schema.File; import org.iso.standards.iso._19770.__2._2014_dis.schema.Meta; import javax.xml.datatype.XMLGregorianCalendar; import java.util.Date; import java.util.List; import static com.labs64.utils.swid.support.JAXBUtils.convertDateToXMLGregorianCalendar;
package com.labs64.utils.swid.builder; public class EvidenceBuilder extends BaseElementBuilder<Evidence, EvidenceBuilder> { /** * adds a {@link Directory}, {@link File} or {@link Process} object. * * @param directoryOrFileOrProcess * @return reference to this object */ public EvidenceBuilder directoryOrFileOrProcess(Meta directoryOrFileOrProcess) { item.getDirectoryOrFileOrProcess().add(directoryOrFileOrProcess); return this; } /** * adds a list of {@link Directory}, {@link File} and {@link Process} objects. * * @param directoryOrFileOrProcess * @return reference to this object */ public EvidenceBuilder directoryOrFileOrProcess(List<Meta> directoryOrFileOrProcess) { if (directoryOrFileOrProcess != null) { item.getDirectoryOrFileOrProcess().addAll(directoryOrFileOrProcess); } return this; } /** * Sets the value of the date property. * * @param date * allowed object is * {@link Date } * */ public EvidenceBuilder date(Date date) {
// Path: src/main/java/com/labs64/utils/swid/support/JAXBUtils.java // public static XMLGregorianCalendar convertDateToXMLGregorianCalendar(final Date date) { // try { // GregorianCalendar cal = new GregorianCalendar(); // cal.setTime(date); // XMLGregorianCalendar calXml = DatatypeFactory.newInstance().newXMLGregorianCalendar( // cal.get(Calendar.YEAR), // cal.get(Calendar.MONTH) + 1, // cal.get(Calendar.DAY_OF_MONTH), // cal.get(Calendar.HOUR_OF_DAY), // cal.get(Calendar.MINUTE), // cal.get(Calendar.SECOND), // cal.get(Calendar.MILLISECOND), // 0); // return calXml; // } catch (DatatypeConfigurationException e) { // throw new SwidException("Cannot convert date", e); // } // } // Path: src/main/java/com/labs64/utils/swid/builder/EvidenceBuilder.java import org.iso.standards.iso._19770.__2._2014_dis.schema.Directory; import org.iso.standards.iso._19770.__2._2014_dis.schema.Evidence; import org.iso.standards.iso._19770.__2._2014_dis.schema.File; import org.iso.standards.iso._19770.__2._2014_dis.schema.Meta; import javax.xml.datatype.XMLGregorianCalendar; import java.util.Date; import java.util.List; import static com.labs64.utils.swid.support.JAXBUtils.convertDateToXMLGregorianCalendar; package com.labs64.utils.swid.builder; public class EvidenceBuilder extends BaseElementBuilder<Evidence, EvidenceBuilder> { /** * adds a {@link Directory}, {@link File} or {@link Process} object. * * @param directoryOrFileOrProcess * @return reference to this object */ public EvidenceBuilder directoryOrFileOrProcess(Meta directoryOrFileOrProcess) { item.getDirectoryOrFileOrProcess().add(directoryOrFileOrProcess); return this; } /** * adds a list of {@link Directory}, {@link File} and {@link Process} objects. * * @param directoryOrFileOrProcess * @return reference to this object */ public EvidenceBuilder directoryOrFileOrProcess(List<Meta> directoryOrFileOrProcess) { if (directoryOrFileOrProcess != null) { item.getDirectoryOrFileOrProcess().addAll(directoryOrFileOrProcess); } return this; } /** * Sets the value of the date property. * * @param date * allowed object is * {@link Date } * */ public EvidenceBuilder date(Date date) {
return date(convertDateToXMLGregorianCalendar(date));
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/builder/ProcessBuilder.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Process; import java.math.BigInteger;
package com.labs64.utils.swid.builder; public class ProcessBuilder extends BaseElementBuilder<Process, ProcessBuilder> { /** * Sets the value of the name property. * * @param name * allowed object is * {@link String } * @return reference to this object */ public ProcessBuilder name(String name) { item.setName(name); return this; } /** * Sets the value of the pid property. * * @param pid * allowed object is * {@link BigInteger } * @return reference to this object */ public ProcessBuilder pid(BigInteger pid) { item.setPid(pid); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getName())) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/main/java/com/labs64/utils/swid/builder/ProcessBuilder.java import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.Process; import java.math.BigInteger; package com.labs64.utils.swid.builder; public class ProcessBuilder extends BaseElementBuilder<Process, ProcessBuilder> { /** * Sets the value of the name property. * * @param name * allowed object is * {@link String } * @return reference to this object */ public ProcessBuilder name(String name) { item.setName(name); return this; } /** * Sets the value of the pid property. * * @param pid * allowed object is * {@link BigInteger } * @return reference to this object */ public ProcessBuilder pid(BigInteger pid) { item.setPid(pid); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getName())) {
throw new SwidException("'process.name' is not set");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/builder/FileBuilder.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.File; import java.math.BigInteger;
package com.labs64.utils.swid.builder; public class FileBuilder extends FilesystemItemBuilder<File, FileBuilder> { /** * Sets the value of the name property. * * @param name * allowed object is * {@link String } * */ public FileBuilder name(String name) { this.item.setName(name); return this; } /** * Sets the value of the size property. * * @param size * allowed object is * {@link BigInteger } * */ public FileBuilder size(BigInteger size) { this.item.setSize(size); return this; } /** * Sets the value of the version property. * * @param version * allowed object is * {@link String } * */ public FileBuilder version(String version) { this.item.setVersion(version); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getName())) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/main/java/com/labs64/utils/swid/builder/FileBuilder.java import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.File; import java.math.BigInteger; package com.labs64.utils.swid.builder; public class FileBuilder extends FilesystemItemBuilder<File, FileBuilder> { /** * Sets the value of the name property. * * @param name * allowed object is * {@link String } * */ public FileBuilder name(String name) { this.item.setName(name); return this; } /** * Sets the value of the size property. * * @param size * allowed object is * {@link BigInteger } * */ public FileBuilder size(BigInteger size) { this.item.setSize(size); return this; } /** * Sets the value of the version property. * * @param version * allowed object is * {@link String } * */ public FileBuilder version(String version) { this.item.setVersion(version); return this; } @Override protected void validate() { if (StringUtils.isBlank(item.getName())) {
throw new SwidException("'file.name' is not set");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/support/SwidUtils.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.net.URI; import java.net.URISyntaxException; import java.text.SimpleDateFormat; import java.util.Date;
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.support; /** * Support class provides convenient methods for working with SWID entities. */ public final class SwidUtils { public static final String SWIDTAG_FILE_EXTENSION = "swidtag"; private static final String DELIMITER = "."; /** * Generate domain date in format <code>'yyyy-MM'</code>. * * @param domainDate * the domain date * @return generated domain date in format <code>'yyyy-MM'</code>; e.g. <code>'2010-04'</code> */ public static String generateDomainDate(final Date domainDate) { if (domainDate == null) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/main/java/com/labs64/utils/swid/support/SwidUtils.java import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.net.URI; import java.net.URISyntaxException; import java.text.SimpleDateFormat; import java.util.Date; /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.support; /** * Support class provides convenient methods for working with SWID entities. */ public final class SwidUtils { public static final String SWIDTAG_FILE_EXTENSION = "swidtag"; private static final String DELIMITER = "."; /** * Generate domain date in format <code>'yyyy-MM'</code>. * * @param domainDate * the domain date * @return generated domain date in format <code>'yyyy-MM'</code>; e.g. <code>'2010-04'</code> */ public static String generateDomainDate(final Date domainDate) { if (domainDate == null) {
throw new SwidException("domainDate isn't defined");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/io/SwidWriter.java
// Path: src/main/java/com/labs64/utils/swid/support/JAXBUtils.java // public final class JAXBUtils { // // public static <T> T readObject(final String resource, final Class<T> expectedType) { // return readObjectFromInputStream(JAXBUtils.class.getClassLoader().getResourceAsStream(resource), expectedType); // } // // public static <T> T readObjectFromString(final String content, final Class<T> expectedType) { // return readObjectFromInputStream(new ByteArrayInputStream(content.getBytes()), expectedType); // } // // public static <T> T readObjectFromInputStream(final InputStream inputStream, final Class<T> expectedType) { // try { // JAXBContext jaxbContext = JAXBContext.newInstance(expectedType); // Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); // JAXBElement<T> element = unmarshaller.unmarshal(new StreamSource(inputStream), expectedType); // return element.getValue(); // } catch (final JAXBException e) { // throw new SwidException("Cannot process resource.", e); // } // } // // /** // * Write XML item to the given destination. // * // * @param entity // * XML item // * @param destination // * destination to write to. Supported destinations: {@link java.io.OutputStream}, {@link java.io.File}, // * {@link java.io.Writer} // * @param comment // * optional comment which will be added at the begining of the generated XML // * @throws IllegalArgumentException // * @throws SwidException // * @param <T> // * JAXB item // */ // public static <T> void writeObject(final T entity, final Object destination, final String comment) { // try { // JAXBContext jaxbContext; // if (entity instanceof JAXBElement) { // jaxbContext = JAXBContext.newInstance(((JAXBElement) entity).getValue().getClass()); // } else { // jaxbContext = JAXBContext.newInstance(entity.getClass()); // } // // Marshaller marshaller = jaxbContext.createMarshaller(); // marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // // if (StringUtils.isNotBlank(comment)) { // marshaller.setProperty("com.sun.xml.bind.xmlHeaders", comment); // } // // if (destination instanceof java.io.OutputStream) { // marshaller.marshal(entity, (OutputStream) destination); // } else if (destination instanceof java.io.File) { // marshaller.marshal(entity, (java.io.File) destination); // } else if (destination instanceof java.io.Writer) { // marshaller.marshal(entity, (java.io.Writer) destination); // } else { // throw new IllegalArgumentException("Unsupported destination."); // } // } catch (final JAXBException e) { // throw new SwidException("Cannot write object.", e); // } // } // // /** // * Write XML item to the string. // * // * @param entity // * XML item // * @throws IllegalArgumentException // * @throws SwidException // * @param <T> // * JAXB item // */ // public static <T> String writeObjectToString(final T entity) { // ByteArrayOutputStream destination = new ByteArrayOutputStream(); // writeObject(entity, destination, null); // return destination.toString(); // } // // /** // * Convert {@link Date} to {@link XMLGregorianCalendar}. // * // * @param date // * XML item // */ // public static XMLGregorianCalendar convertDateToXMLGregorianCalendar(final Date date) { // try { // GregorianCalendar cal = new GregorianCalendar(); // cal.setTime(date); // XMLGregorianCalendar calXml = DatatypeFactory.newInstance().newXMLGregorianCalendar( // cal.get(Calendar.YEAR), // cal.get(Calendar.MONTH) + 1, // cal.get(Calendar.DAY_OF_MONTH), // cal.get(Calendar.HOUR_OF_DAY), // cal.get(Calendar.MINUTE), // cal.get(Calendar.SECOND), // cal.get(Calendar.MILLISECOND), // 0); // return calXml; // } catch (DatatypeConfigurationException e) { // throw new SwidException("Cannot convert date", e); // } // } // }
import com.labs64.utils.swid.support.JAXBUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.ObjectFactory; import org.iso.standards.iso._19770.__2._2014_dis.schema.SoftwareIdentity; import java.io.File; import java.util.Date;
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.io; /** * A writer for SoftWare IDentification (SWID) Tags * {@link org.iso.standards.iso._19770.__2._2014_dis.schema.SoftwareIdentity}. */ public class SwidWriter { private static final ObjectFactory objectFactory = new ObjectFactory(); /** * Write the object into an output stream. * * @param swidTag * The SWID Tag object to be written. * @param output * SWID Tag will be added to this stream. * * @throws com.labs64.utils.swid.exception.SwidException * If any unexpected problem occurs during the writing. * @throws IllegalArgumentException * If any of the method parameters are null */ public void write(final SoftwareIdentity swidTag, final java.io.OutputStream output) {
// Path: src/main/java/com/labs64/utils/swid/support/JAXBUtils.java // public final class JAXBUtils { // // public static <T> T readObject(final String resource, final Class<T> expectedType) { // return readObjectFromInputStream(JAXBUtils.class.getClassLoader().getResourceAsStream(resource), expectedType); // } // // public static <T> T readObjectFromString(final String content, final Class<T> expectedType) { // return readObjectFromInputStream(new ByteArrayInputStream(content.getBytes()), expectedType); // } // // public static <T> T readObjectFromInputStream(final InputStream inputStream, final Class<T> expectedType) { // try { // JAXBContext jaxbContext = JAXBContext.newInstance(expectedType); // Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); // JAXBElement<T> element = unmarshaller.unmarshal(new StreamSource(inputStream), expectedType); // return element.getValue(); // } catch (final JAXBException e) { // throw new SwidException("Cannot process resource.", e); // } // } // // /** // * Write XML item to the given destination. // * // * @param entity // * XML item // * @param destination // * destination to write to. Supported destinations: {@link java.io.OutputStream}, {@link java.io.File}, // * {@link java.io.Writer} // * @param comment // * optional comment which will be added at the begining of the generated XML // * @throws IllegalArgumentException // * @throws SwidException // * @param <T> // * JAXB item // */ // public static <T> void writeObject(final T entity, final Object destination, final String comment) { // try { // JAXBContext jaxbContext; // if (entity instanceof JAXBElement) { // jaxbContext = JAXBContext.newInstance(((JAXBElement) entity).getValue().getClass()); // } else { // jaxbContext = JAXBContext.newInstance(entity.getClass()); // } // // Marshaller marshaller = jaxbContext.createMarshaller(); // marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // // if (StringUtils.isNotBlank(comment)) { // marshaller.setProperty("com.sun.xml.bind.xmlHeaders", comment); // } // // if (destination instanceof java.io.OutputStream) { // marshaller.marshal(entity, (OutputStream) destination); // } else if (destination instanceof java.io.File) { // marshaller.marshal(entity, (java.io.File) destination); // } else if (destination instanceof java.io.Writer) { // marshaller.marshal(entity, (java.io.Writer) destination); // } else { // throw new IllegalArgumentException("Unsupported destination."); // } // } catch (final JAXBException e) { // throw new SwidException("Cannot write object.", e); // } // } // // /** // * Write XML item to the string. // * // * @param entity // * XML item // * @throws IllegalArgumentException // * @throws SwidException // * @param <T> // * JAXB item // */ // public static <T> String writeObjectToString(final T entity) { // ByteArrayOutputStream destination = new ByteArrayOutputStream(); // writeObject(entity, destination, null); // return destination.toString(); // } // // /** // * Convert {@link Date} to {@link XMLGregorianCalendar}. // * // * @param date // * XML item // */ // public static XMLGregorianCalendar convertDateToXMLGregorianCalendar(final Date date) { // try { // GregorianCalendar cal = new GregorianCalendar(); // cal.setTime(date); // XMLGregorianCalendar calXml = DatatypeFactory.newInstance().newXMLGregorianCalendar( // cal.get(Calendar.YEAR), // cal.get(Calendar.MONTH) + 1, // cal.get(Calendar.DAY_OF_MONTH), // cal.get(Calendar.HOUR_OF_DAY), // cal.get(Calendar.MINUTE), // cal.get(Calendar.SECOND), // cal.get(Calendar.MILLISECOND), // 0); // return calXml; // } catch (DatatypeConfigurationException e) { // throw new SwidException("Cannot convert date", e); // } // } // } // Path: src/main/java/com/labs64/utils/swid/io/SwidWriter.java import com.labs64.utils.swid.support.JAXBUtils; import org.iso.standards.iso._19770.__2._2014_dis.schema.ObjectFactory; import org.iso.standards.iso._19770.__2._2014_dis.schema.SoftwareIdentity; import java.io.File; import java.util.Date; /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.io; /** * A writer for SoftWare IDentification (SWID) Tags * {@link org.iso.standards.iso._19770.__2._2014_dis.schema.SoftwareIdentity}. */ public class SwidWriter { private static final ObjectFactory objectFactory = new ObjectFactory(); /** * Write the object into an output stream. * * @param swidTag * The SWID Tag object to be written. * @param output * SWID Tag will be added to this stream. * * @throws com.labs64.utils.swid.exception.SwidException * If any unexpected problem occurs during the writing. * @throws IllegalArgumentException * If any of the method parameters are null */ public void write(final SoftwareIdentity swidTag, final java.io.OutputStream output) {
JAXBUtils.writeObject(objectFactory.createSoftwareIdentity(swidTag), output, getComment());
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/SwidBuilder.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/processor/SwidProcessor.java // public interface SwidProcessor { // // /** // * Process the provided source, returning a SWID tag object. // * // * @return SWID tag object. // */ // SoftwareIdentity process(); // // }
import org.iso.standards.iso._19770.__2._2014_dis.schema.SoftwareIdentity; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.processor.SwidProcessor;
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid; /** * A builder for creating a SoftWare IDentification (SWID) Tags {@link SoftwareIdentity}. */ public final class SwidBuilder { /** * Build SoftWare IDentification (SWID) Tag. * * @param processor * {@link SwidProcessor} implementation * @throws SwidException * @return SoftWare IDentification (SWID) Tag {@link SoftwareIdentity} object */ public SoftwareIdentity build(final SwidProcessor processor) { if (processor == null) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/processor/SwidProcessor.java // public interface SwidProcessor { // // /** // * Process the provided source, returning a SWID tag object. // * // * @return SWID tag object. // */ // SoftwareIdentity process(); // // } // Path: src/main/java/com/labs64/utils/swid/SwidBuilder.java import org.iso.standards.iso._19770.__2._2014_dis.schema.SoftwareIdentity; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.processor.SwidProcessor; /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid; /** * A builder for creating a SoftWare IDentification (SWID) Tags {@link SoftwareIdentity}. */ public final class SwidBuilder { /** * Build SoftWare IDentification (SWID) Tag. * * @param processor * {@link SwidProcessor} implementation * @throws SwidException * @return SoftWare IDentification (SWID) Tag {@link SoftwareIdentity} object */ public SoftwareIdentity build(final SwidProcessor processor) { if (processor == null) {
throw new SwidException("processor is null");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/support/IdGenerator.java // public interface IdGenerator { // // /** // * Return next element identifier. // * // * @return next element identifier. // */ // String nextId(); // // } // // Path: src/main/java/com/labs64/utils/swid/support/NullIdGenerator.java // public class NullIdGenerator implements IdGenerator { // // @Override // public String nextId() { // return null; // } // // }
import com.labs64.utils.swid.builder.*; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.support.IdGenerator; import com.labs64.utils.swid.support.NullIdGenerator; import org.iso.standards.iso._19770.__2._2014_dis.schema.*; import org.w3._2000._09.xmldsig_.SignatureType; import javax.xml.namespace.QName; import java.math.BigInteger; import java.util.Map;
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.processor; /** * Default SWID tag processor creates SWID tag with pre-defined mandatory elements. * * @see <a href="https://www.iso.org/standard/65666.html">ISO/IEC 19770-2:2015</a> for guidance. */ public class DefaultSwidProcessor implements SwidProcessor { protected final SoftwareIdentity swidTag;
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/support/IdGenerator.java // public interface IdGenerator { // // /** // * Return next element identifier. // * // * @return next element identifier. // */ // String nextId(); // // } // // Path: src/main/java/com/labs64/utils/swid/support/NullIdGenerator.java // public class NullIdGenerator implements IdGenerator { // // @Override // public String nextId() { // return null; // } // // } // Path: src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java import com.labs64.utils.swid.builder.*; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.support.IdGenerator; import com.labs64.utils.swid.support.NullIdGenerator; import org.iso.standards.iso._19770.__2._2014_dis.schema.*; import org.w3._2000._09.xmldsig_.SignatureType; import javax.xml.namespace.QName; import java.math.BigInteger; import java.util.Map; /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.processor; /** * Default SWID tag processor creates SWID tag with pre-defined mandatory elements. * * @see <a href="https://www.iso.org/standard/65666.html">ISO/IEC 19770-2:2015</a> for guidance. */ public class DefaultSwidProcessor implements SwidProcessor { protected final SoftwareIdentity swidTag;
protected IdGenerator idGenerator;
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/support/IdGenerator.java // public interface IdGenerator { // // /** // * Return next element identifier. // * // * @return next element identifier. // */ // String nextId(); // // } // // Path: src/main/java/com/labs64/utils/swid/support/NullIdGenerator.java // public class NullIdGenerator implements IdGenerator { // // @Override // public String nextId() { // return null; // } // // }
import com.labs64.utils.swid.builder.*; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.support.IdGenerator; import com.labs64.utils.swid.support.NullIdGenerator; import org.iso.standards.iso._19770.__2._2014_dis.schema.*; import org.w3._2000._09.xmldsig_.SignatureType; import javax.xml.namespace.QName; import java.math.BigInteger; import java.util.Map;
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.processor; /** * Default SWID tag processor creates SWID tag with pre-defined mandatory elements. * * @see <a href="https://www.iso.org/standard/65666.html">ISO/IEC 19770-2:2015</a> for guidance. */ public class DefaultSwidProcessor implements SwidProcessor { protected final SoftwareIdentity swidTag; protected IdGenerator idGenerator; /** * Creates SWID Tag default processor. */ public DefaultSwidProcessor() { swidTag = new SoftwareIdentity();
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/support/IdGenerator.java // public interface IdGenerator { // // /** // * Return next element identifier. // * // * @return next element identifier. // */ // String nextId(); // // } // // Path: src/main/java/com/labs64/utils/swid/support/NullIdGenerator.java // public class NullIdGenerator implements IdGenerator { // // @Override // public String nextId() { // return null; // } // // } // Path: src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java import com.labs64.utils.swid.builder.*; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.support.IdGenerator; import com.labs64.utils.swid.support.NullIdGenerator; import org.iso.standards.iso._19770.__2._2014_dis.schema.*; import org.w3._2000._09.xmldsig_.SignatureType; import javax.xml.namespace.QName; import java.math.BigInteger; import java.util.Map; /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.processor; /** * Default SWID tag processor creates SWID tag with pre-defined mandatory elements. * * @see <a href="https://www.iso.org/standard/65666.html">ISO/IEC 19770-2:2015</a> for guidance. */ public class DefaultSwidProcessor implements SwidProcessor { protected final SoftwareIdentity swidTag; protected IdGenerator idGenerator; /** * Creates SWID Tag default processor. */ public DefaultSwidProcessor() { swidTag = new SoftwareIdentity();
setGenerator(new NullIdGenerator());
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/support/IdGenerator.java // public interface IdGenerator { // // /** // * Return next element identifier. // * // * @return next element identifier. // */ // String nextId(); // // } // // Path: src/main/java/com/labs64/utils/swid/support/NullIdGenerator.java // public class NullIdGenerator implements IdGenerator { // // @Override // public String nextId() { // return null; // } // // }
import com.labs64.utils.swid.builder.*; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.support.IdGenerator; import com.labs64.utils.swid.support.NullIdGenerator; import org.iso.standards.iso._19770.__2._2014_dis.schema.*; import org.w3._2000._09.xmldsig_.SignatureType; import javax.xml.namespace.QName; import java.math.BigInteger; import java.util.Map;
* {@link Link} * @return a reference to this object. */ public DefaultSwidProcessor addLink(final Link link) { swidTag.getEntityOrEvidenceOrLink().add(link); return this; } /** * <p> * adds an {@link SignatureType} object to the swid tag * </p> * * @param signature * {@link SignatureType} * @return a reference to this object. */ public DefaultSwidProcessor addSignature(final SignatureType signature) { swidTag.getEntityOrEvidenceOrLink().add(signature); return this; } /** * Validate whether processor configuration is valid. * * @throws com.labs64.utils.swid.exception.SwidException * in case of invalid processor configuration */ public void validate() { if (swidTag.getName() == null) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // // Path: src/main/java/com/labs64/utils/swid/support/IdGenerator.java // public interface IdGenerator { // // /** // * Return next element identifier. // * // * @return next element identifier. // */ // String nextId(); // // } // // Path: src/main/java/com/labs64/utils/swid/support/NullIdGenerator.java // public class NullIdGenerator implements IdGenerator { // // @Override // public String nextId() { // return null; // } // // } // Path: src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java import com.labs64.utils.swid.builder.*; import com.labs64.utils.swid.exception.SwidException; import com.labs64.utils.swid.support.IdGenerator; import com.labs64.utils.swid.support.NullIdGenerator; import org.iso.standards.iso._19770.__2._2014_dis.schema.*; import org.w3._2000._09.xmldsig_.SignatureType; import javax.xml.namespace.QName; import java.math.BigInteger; import java.util.Map; * {@link Link} * @return a reference to this object. */ public DefaultSwidProcessor addLink(final Link link) { swidTag.getEntityOrEvidenceOrLink().add(link); return this; } /** * <p> * adds an {@link SignatureType} object to the swid tag * </p> * * @param signature * {@link SignatureType} * @return a reference to this object. */ public DefaultSwidProcessor addSignature(final SignatureType signature) { swidTag.getEntityOrEvidenceOrLink().add(signature); return this; } /** * Validate whether processor configuration is valid. * * @throws com.labs64.utils.swid.exception.SwidException * in case of invalid processor configuration */ public void validate() { if (swidTag.getName() == null) {
throw new SwidException("'product_title' is not set");
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/support/JAXBUtils.java
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // }
import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import javax.xml.bind.*; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.transform.stream.StreamSource; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar;
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.support; /** * Support class provides convenient methods for working with JAXB. */ public final class JAXBUtils { public static <T> T readObject(final String resource, final Class<T> expectedType) { return readObjectFromInputStream(JAXBUtils.class.getClassLoader().getResourceAsStream(resource), expectedType); } public static <T> T readObjectFromString(final String content, final Class<T> expectedType) { return readObjectFromInputStream(new ByteArrayInputStream(content.getBytes()), expectedType); } public static <T> T readObjectFromInputStream(final InputStream inputStream, final Class<T> expectedType) { try { JAXBContext jaxbContext = JAXBContext.newInstance(expectedType); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<T> element = unmarshaller.unmarshal(new StreamSource(inputStream), expectedType); return element.getValue(); } catch (final JAXBException e) {
// Path: src/main/java/com/labs64/utils/swid/exception/SwidException.java // public class SwidException extends RuntimeException { // // private static final long serialVersionUID = -5365630127756068164L; // // /** // * Constructs an <code>SwidException</code> with no detail message. // */ // public SwidException() { // super(); // } // // /** // * Constructs an <code>SwidException</code> with the specified detail message. // * // * @param s // * the detail message. // */ // public SwidException(final String s) { // super(s); // } // // /** // * Constructs a new exception with the specified cause and a detail message of // * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of // * <tt>cause</tt>). This constructor is useful for exceptions that are little more than wrappers for other // * throwables (for example, {@link java.security.PrivilegedActionException}). // * // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final Throwable cause) { // super(cause); // } // // /** // * Constructs a new exception with the specified detail message and cause. // * // * <p> // * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically incorporated in this // * exception's detail message. // * // * @param message // * the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). // * @param cause // * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A // * <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) // */ // public SwidException(final String message, final Throwable cause) { // super(message, cause); // } // // } // Path: src/main/java/com/labs64/utils/swid/support/JAXBUtils.java import com.labs64.utils.swid.exception.SwidException; import org.apache.commons.lang3.StringUtils; import javax.xml.bind.*; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.transform.stream.StreamSource; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.labs64.utils.swid.support; /** * Support class provides convenient methods for working with JAXB. */ public final class JAXBUtils { public static <T> T readObject(final String resource, final Class<T> expectedType) { return readObjectFromInputStream(JAXBUtils.class.getClassLoader().getResourceAsStream(resource), expectedType); } public static <T> T readObjectFromString(final String content, final Class<T> expectedType) { return readObjectFromInputStream(new ByteArrayInputStream(content.getBytes()), expectedType); } public static <T> T readObjectFromInputStream(final InputStream inputStream, final Class<T> expectedType) { try { JAXBContext jaxbContext = JAXBContext.newInstance(expectedType); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<T> element = unmarshaller.unmarshal(new StreamSource(inputStream), expectedType); return element.getValue(); } catch (final JAXBException e) {
throw new SwidException("Cannot process resource.", e);
gradle-fury/gradle-fury
it/MavenConsumers/MavenAPK/src/main/java/com/chrisdoyle/it/mavenconsumer/MainActivity.java
// Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // }
import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import com.chrisdoyle.helloworld.Message;
package com.chrisdoyle.it.mavenconsumer; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView tv = (TextView) findViewById(R.id.helloworld);
// Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // } // Path: it/MavenConsumers/MavenAPK/src/main/java/com/chrisdoyle/it/mavenconsumer/MainActivity.java import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import com.chrisdoyle.helloworld.Message; package com.chrisdoyle.it.mavenconsumer; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView tv = (TextView) findViewById(R.id.helloworld);
com.chrisdoyle.helloworld.BogusUtil.setMessage(tv, new Message("hi"));
gradle-fury/gradle-fury
it/GradleConsumers/app2/src/main/java/com/chrisdoyle/it/gradleconsumer/MainActivity.java
// Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // }
import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import com.chrisdoyle.helloworld.Message;
package com.chrisdoyle.it.gradleconsumer; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView tv = (TextView) findViewById(R.id.helloworld);
// Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // } // Path: it/GradleConsumers/app2/src/main/java/com/chrisdoyle/it/gradleconsumer/MainActivity.java import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import com.chrisdoyle.helloworld.Message; package com.chrisdoyle.it.gradleconsumer; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView tv = (TextView) findViewById(R.id.helloworld);
com.chrisdoyle.helloworld.BogusUtil.setMessage(tv, new Message("hi"));
gradle-fury/gradle-fury
hello-world-apk/src/main/java/com/chrisdoyle/helloworld/app/HelloWorldActivity.java
// Path: hello-world-aar/src/main/java/com/chrisdoyle/helloworld/BogusUtil.java // public final class BogusUtil { // // public static void setMessage(@NonNull final TextView view, @NonNull final Message message) { // view.setText(message.getMessage()); // } // // } // // Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // }
import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import com.chrisdoyle.helloworld.BogusUtil; import com.chrisdoyle.helloworld.Message;
package com.chrisdoyle.helloworld.app; public class HelloWorldActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hello_world); final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // exit the application finish(); } }); final TextView content = (TextView) findViewById(R.id.content);
// Path: hello-world-aar/src/main/java/com/chrisdoyle/helloworld/BogusUtil.java // public final class BogusUtil { // // public static void setMessage(@NonNull final TextView view, @NonNull final Message message) { // view.setText(message.getMessage()); // } // // } // // Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // } // Path: hello-world-apk/src/main/java/com/chrisdoyle/helloworld/app/HelloWorldActivity.java import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import com.chrisdoyle.helloworld.BogusUtil; import com.chrisdoyle.helloworld.Message; package com.chrisdoyle.helloworld.app; public class HelloWorldActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hello_world); final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // exit the application finish(); } }); final TextView content = (TextView) findViewById(R.id.content);
final Message message = new Message(getString(R.string.app_name));
gradle-fury/gradle-fury
hello-world-apk/src/main/java/com/chrisdoyle/helloworld/app/HelloWorldActivity.java
// Path: hello-world-aar/src/main/java/com/chrisdoyle/helloworld/BogusUtil.java // public final class BogusUtil { // // public static void setMessage(@NonNull final TextView view, @NonNull final Message message) { // view.setText(message.getMessage()); // } // // } // // Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // }
import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import com.chrisdoyle.helloworld.BogusUtil; import com.chrisdoyle.helloworld.Message;
package com.chrisdoyle.helloworld.app; public class HelloWorldActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hello_world); final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // exit the application finish(); } }); final TextView content = (TextView) findViewById(R.id.content); final Message message = new Message(getString(R.string.app_name));
// Path: hello-world-aar/src/main/java/com/chrisdoyle/helloworld/BogusUtil.java // public final class BogusUtil { // // public static void setMessage(@NonNull final TextView view, @NonNull final Message message) { // view.setText(message.getMessage()); // } // // } // // Path: hello-universe-lib/src/main/java/com/chrisdoyle/helloworld/Message.java // public class Message implements Comparable<Message>, Serializable { // // private String message; // // public Message(final String message) { // setMessage(message); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Comparable<T>#compareTo(T) // */ // @Override // public int compareTo(final Message cmp) { // return CompareToBuilder.reflectionCompare(this, cmp); // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#equals(java.lang.Object) // */ // @Override // public boolean equals(Object o) { // return EqualsBuilder.reflectionEquals(this, o); // } // // public String getMessage() { // return this.message; // } // // /* // * (non-Javadoc) // * // * @see java.lang.Object#hashCode() // */ // @Override // public int hashCode() { // return HashCodeBuilder.reflectionHashCode(this); // } // // public void setMessage(final String message) { // Validate.notEmpty(message); // this.message = message; // } // // /* (non-Javadoc) // * @see java.lang.Object#toString() // */ // @Override // public String toString() { // return ReflectionToStringBuilder.toString(this); // } // } // Path: hello-world-apk/src/main/java/com/chrisdoyle/helloworld/app/HelloWorldActivity.java import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import com.chrisdoyle.helloworld.BogusUtil; import com.chrisdoyle.helloworld.Message; package com.chrisdoyle.helloworld.app; public class HelloWorldActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hello_world); final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // exit the application finish(); } }); final TextView content = (TextView) findViewById(R.id.content); final Message message = new Message(getString(R.string.app_name));
BogusUtil.setMessage(content, message);
pqdn/Cephei
smart-item/src/main/java/com/metalabs/cephei/smartitem/impls/DefaultSmartItemRequestFactory.java
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequest.java // public interface SmartItemRequest { // String execute(); // } // // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequestFactory.java // public interface SmartItemRequestFactory { // SmartItemRequest makeSmartItemRequest(String url, String smartItemDescription); // }
import com.metalabs.cephei.smartitem.interfaces.SmartItemRequest; import com.metalabs.cephei.smartitem.interfaces.SmartItemRequestFactory; import org.springframework.stereotype.Component;
package com.metalabs.cephei.smartitem.impls; @Component public class DefaultSmartItemRequestFactory implements SmartItemRequestFactory { @Override
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequest.java // public interface SmartItemRequest { // String execute(); // } // // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequestFactory.java // public interface SmartItemRequestFactory { // SmartItemRequest makeSmartItemRequest(String url, String smartItemDescription); // } // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/impls/DefaultSmartItemRequestFactory.java import com.metalabs.cephei.smartitem.interfaces.SmartItemRequest; import com.metalabs.cephei.smartitem.interfaces.SmartItemRequestFactory; import org.springframework.stereotype.Component; package com.metalabs.cephei.smartitem.impls; @Component public class DefaultSmartItemRequestFactory implements SmartItemRequestFactory { @Override
public SmartItemRequest makeSmartItemRequest(String url, String smartItemDescription) {
pqdn/Cephei
smart-item/src/main/java/com/metalabs/cephei/smartitem/SmartItem.java
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/attribute/Attribute.java // abstract public class Attribute { // // }
import com.metalabs.cephei.smartitem.attribute.Attribute; import java.util.Map; import java.util.Set;
package com.metalabs.cephei.smartitem; public class SmartItem { private String json; private String url;
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/attribute/Attribute.java // abstract public class Attribute { // // } // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/SmartItem.java import com.metalabs.cephei.smartitem.attribute.Attribute; import java.util.Map; import java.util.Set; package com.metalabs.cephei.smartitem; public class SmartItem { private String json; private String url;
private Map<String, Attribute> attrbutes;
pqdn/Cephei
web/src/main/java/com/metalabs/cephei/web/service/PseudoBotServiceImpl.java
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/repository/PseudoBotRepository.java // @Repository // public interface PseudoBotRepository extends JpaRepository<PseudoBot, Integer> { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // }
import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.repository.PseudoBotRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; import java.util.Optional;
package com.metalabs.cephei.web.service; @Component public class PseudoBotServiceImpl implements PseudoBotService { @Autowired
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/repository/PseudoBotRepository.java // @Repository // public interface PseudoBotRepository extends JpaRepository<PseudoBot, Integer> { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // } // Path: web/src/main/java/com/metalabs/cephei/web/service/PseudoBotServiceImpl.java import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.repository.PseudoBotRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; import java.util.Optional; package com.metalabs.cephei.web.service; @Component public class PseudoBotServiceImpl implements PseudoBotService { @Autowired
private PseudoBotRepository pseudoBotRepository;
pqdn/Cephei
web/src/main/java/com/metalabs/cephei/web/service/PseudoBotServiceImpl.java
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/repository/PseudoBotRepository.java // @Repository // public interface PseudoBotRepository extends JpaRepository<PseudoBot, Integer> { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // }
import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.repository.PseudoBotRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; import java.util.Optional;
package com.metalabs.cephei.web.service; @Component public class PseudoBotServiceImpl implements PseudoBotService { @Autowired private PseudoBotRepository pseudoBotRepository; @Override
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/repository/PseudoBotRepository.java // @Repository // public interface PseudoBotRepository extends JpaRepository<PseudoBot, Integer> { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // } // Path: web/src/main/java/com/metalabs/cephei/web/service/PseudoBotServiceImpl.java import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.repository.PseudoBotRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; import java.util.Optional; package com.metalabs.cephei.web.service; @Component public class PseudoBotServiceImpl implements PseudoBotService { @Autowired private PseudoBotRepository pseudoBotRepository; @Override
public List<PseudoBot> findAll() {
pqdn/Cephei
web/src/main/java/com/metalabs/cephei/web/controllers/Example.java
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/service/PseudoBotService.java // public interface PseudoBotService { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // }
import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.service.PseudoBotService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; import java.util.List;
package com.metalabs.cephei.web.controllers; @RestController public class Example { @Autowired
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/service/PseudoBotService.java // public interface PseudoBotService { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // } // Path: web/src/main/java/com/metalabs/cephei/web/controllers/Example.java import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.service.PseudoBotService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; import java.util.List; package com.metalabs.cephei.web.controllers; @RestController public class Example { @Autowired
private PseudoBotService pseudoBotService;
pqdn/Cephei
web/src/main/java/com/metalabs/cephei/web/controllers/Example.java
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/service/PseudoBotService.java // public interface PseudoBotService { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // }
import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.service.PseudoBotService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; import java.util.List;
package com.metalabs.cephei.web.controllers; @RestController public class Example { @Autowired private PseudoBotService pseudoBotService; @RequestMapping("/hello") String example() { return "Hello world"; } @RequestMapping("/example") List<Item> example2() { List<Item> items = Arrays.asList(new Item(12, "Vasay"), new Item(13, "Petya")); return items; } @RequestMapping("/pseudobot")
// Path: web/src/main/java/com/metalabs/cephei/web/model/PseudoBot.java // @Entity // @Table(name = "pseudo_bot") // public class PseudoBot { // // @Id // @GeneratedValue // private int id; // // @Column(name = "description") // private String description; // // public PseudoBot() { // } // // public PseudoBot(String description) { // this.description = description; // } // // public int getId() { // return id; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // @Override // public String toString() { // return "PseudoBot{" + // "id=" + id + // ", description='" + description + '\'' + // '}'; // } // } // // Path: web/src/main/java/com/metalabs/cephei/web/service/PseudoBotService.java // public interface PseudoBotService { // // List<PseudoBot> findAll(); // // Optional<PseudoBot> findById(Integer id); // // PseudoBot save(PseudoBot pseudoBot); // // void delete(PseudoBot pseudoBot); // } // Path: web/src/main/java/com/metalabs/cephei/web/controllers/Example.java import com.metalabs.cephei.web.model.PseudoBot; import com.metalabs.cephei.web.service.PseudoBotService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; import java.util.List; package com.metalabs.cephei.web.controllers; @RestController public class Example { @Autowired private PseudoBotService pseudoBotService; @RequestMapping("/hello") String example() { return "Hello world"; } @RequestMapping("/example") List<Item> example2() { List<Item> items = Arrays.asList(new Item(12, "Vasay"), new Item(13, "Petya")); return items; } @RequestMapping("/pseudobot")
List<PseudoBot> example3() {
pqdn/Cephei
web/src/main/java/com/metalabs/cephei/web/controllers/SmartItemController.java
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequest.java // public interface SmartItemRequest { // String execute(); // } // // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequestFactory.java // public interface SmartItemRequestFactory { // SmartItemRequest makeSmartItemRequest(String url, String smartItemDescription); // }
import com.metalabs.cephei.smartitem.interfaces.SmartItemRequest; import com.metalabs.cephei.smartitem.interfaces.SmartItemRequestFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;
package com.metalabs.cephei.web.controllers; @RestController @RequestMapping("/smart-item") public class SmartItemController { @Autowired
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequest.java // public interface SmartItemRequest { // String execute(); // } // // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequestFactory.java // public interface SmartItemRequestFactory { // SmartItemRequest makeSmartItemRequest(String url, String smartItemDescription); // } // Path: web/src/main/java/com/metalabs/cephei/web/controllers/SmartItemController.java import com.metalabs.cephei.smartitem.interfaces.SmartItemRequest; import com.metalabs.cephei.smartitem.interfaces.SmartItemRequestFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; package com.metalabs.cephei.web.controllers; @RestController @RequestMapping("/smart-item") public class SmartItemController { @Autowired
private SmartItemRequestFactory smartItemRequestFactory;
pqdn/Cephei
web/src/main/java/com/metalabs/cephei/web/controllers/SmartItemController.java
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequest.java // public interface SmartItemRequest { // String execute(); // } // // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequestFactory.java // public interface SmartItemRequestFactory { // SmartItemRequest makeSmartItemRequest(String url, String smartItemDescription); // }
import com.metalabs.cephei.smartitem.interfaces.SmartItemRequest; import com.metalabs.cephei.smartitem.interfaces.SmartItemRequestFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;
package com.metalabs.cephei.web.controllers; @RestController @RequestMapping("/smart-item") public class SmartItemController { @Autowired private SmartItemRequestFactory smartItemRequestFactory; @RequestMapping("/test") public void test(String str1, String str2) { System.out.println("str1=" + str1); System.out.println("str1=" + str2); System.out.println("smart object: " + smartItemRequestFactory); } @RequestMapping("/request") public String request(String url, String smartItemDescription) {
// Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequest.java // public interface SmartItemRequest { // String execute(); // } // // Path: smart-item/src/main/java/com/metalabs/cephei/smartitem/interfaces/SmartItemRequestFactory.java // public interface SmartItemRequestFactory { // SmartItemRequest makeSmartItemRequest(String url, String smartItemDescription); // } // Path: web/src/main/java/com/metalabs/cephei/web/controllers/SmartItemController.java import com.metalabs.cephei.smartitem.interfaces.SmartItemRequest; import com.metalabs.cephei.smartitem.interfaces.SmartItemRequestFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; package com.metalabs.cephei.web.controllers; @RestController @RequestMapping("/smart-item") public class SmartItemController { @Autowired private SmartItemRequestFactory smartItemRequestFactory; @RequestMapping("/test") public void test(String str1, String str2) { System.out.println("str1=" + str1); System.out.println("str1=" + str2); System.out.println("smart object: " + smartItemRequestFactory); } @RequestMapping("/request") public String request(String url, String smartItemDescription) {
SmartItemRequest request = smartItemRequestFactory.makeSmartItemRequest(url, smartItemDescription);
noties/Scrollable
sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentListView.java
// Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // }
import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ListView; import java.util.List; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ItemsGenerator;
package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentListView extends FragmentPagerFragment { private ListView mListView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_list_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mListView = findView(R.id.list_view);
// Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // } // Path: sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentListView.java import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ListView; import java.util.List; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ItemsGenerator; package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentListView extends FragmentPagerFragment { private ListView mListView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_list_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mListView = findView(R.id.list_view);
final List<String> items = ItemsGenerator.generate(100);
noties/Scrollable
sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentRecyclerView.java
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // }
import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator; import ru.noties.vt.ViewTypesAdapter;
package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentRecyclerView extends FragmentPagerFragment { private RecyclerView mRecyclerView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_recycler_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mRecyclerView = findView(R.id.recycler_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); mRecyclerView.setHasFixedSize(true); final ViewTypesAdapter<String> adapter = ViewTypesAdapter.builder(String.class)
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // } // Path: sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentRecyclerView.java import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator; import ru.noties.vt.ViewTypesAdapter; package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentRecyclerView extends FragmentPagerFragment { private RecyclerView mRecyclerView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_recycler_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mRecyclerView = findView(R.id.recycler_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); mRecyclerView.setHasFixedSize(true); final ViewTypesAdapter<String> adapter = ViewTypesAdapter.builder(String.class)
.register(String.class, new ViewTypeItem())
noties/Scrollable
sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentRecyclerView.java
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // }
import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator; import ru.noties.vt.ViewTypesAdapter;
package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentRecyclerView extends FragmentPagerFragment { private RecyclerView mRecyclerView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_recycler_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mRecyclerView = findView(R.id.recycler_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); mRecyclerView.setHasFixedSize(true); final ViewTypesAdapter<String> adapter = ViewTypesAdapter.builder(String.class) .register(String.class, new ViewTypeItem()) .setHasStableIds(false) .build(getContext());
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // } // Path: sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentRecyclerView.java import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator; import ru.noties.vt.ViewTypesAdapter; package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentRecyclerView extends FragmentPagerFragment { private RecyclerView mRecyclerView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_recycler_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mRecyclerView = findView(R.id.recycler_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); mRecyclerView.setHasFixedSize(true); final ViewTypesAdapter<String> adapter = ViewTypesAdapter.builder(String.class) .register(String.class, new ViewTypeItem()) .setHasStableIds(false) .build(getContext());
final List<String> list = ItemsGenerator.generate(100);
noties/Scrollable
sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentScrollView.java
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // }
import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.ScrollView; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator;
package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentScrollView extends FragmentPagerFragment { private ScrollView mScrollView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_scroll_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mScrollView = findView(R.id.scroll_view); // generate mock items final Context context = getContext(); final LayoutInflater inflater = LayoutInflater.from(context); final LinearLayout linearLayout = findView(mScrollView, R.id.linear_layout);
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // } // Path: sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentScrollView.java import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.ScrollView; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator; package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentScrollView extends FragmentPagerFragment { private ScrollView mScrollView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_scroll_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mScrollView = findView(R.id.scroll_view); // generate mock items final Context context = getContext(); final LayoutInflater inflater = LayoutInflater.from(context); final LinearLayout linearLayout = findView(mScrollView, R.id.linear_layout);
final ViewTypeItem viewTypeItem = new ViewTypeItem();
noties/Scrollable
sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentScrollView.java
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // }
import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.ScrollView; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator;
package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentScrollView extends FragmentPagerFragment { private ScrollView mScrollView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_scroll_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mScrollView = findView(R.id.scroll_view); // generate mock items final Context context = getContext(); final LayoutInflater inflater = LayoutInflater.from(context); final LinearLayout linearLayout = findView(mScrollView, R.id.linear_layout); final ViewTypeItem viewTypeItem = new ViewTypeItem(); ViewTypeItem.ItemHolder holder;
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewTypeItem.java // public class ViewTypeItem extends ViewType<String, ViewTypeItem.ItemHolder> { // // @Override // public ItemHolder createView(LayoutInflater inflater, ViewGroup parent) { // return new ItemHolder(inflater.inflate(R.layout.vt_item, parent, false)); // } // // @Override // public void bindView(Context context, ItemHolder holder, String item, List<Object> payloads) { // holder.view.setText(item); // } // // public static class ItemHolder extends HolderSingle<TextView> { // ItemHolder(View itemView) { // super(itemView); // } // } // } // // Path: sample/src/main/java/ru/noties/scrollable/sample/ItemsGenerator.java // public class ItemsGenerator { // // public static List<String> generate(int count) { // final List<String> list = new ArrayList<>(count); // for (int i = 0; i < count; i++) { // list.add("Item #" + i); // } // return list; // } // // private ItemsGenerator() {} // } // Path: sample/src/main/java/ru/noties/scrollable/sample/pager/fragment/FragmentPagerFragmentScrollView.java import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.ScrollView; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewTypeItem; import ru.noties.scrollable.sample.ItemsGenerator; package ru.noties.scrollable.sample.pager.fragment; public class FragmentPagerFragmentScrollView extends FragmentPagerFragment { private ScrollView mScrollView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle sis) { return inflater.inflate(R.layout.fragment_pager_scroll_view, parent, false); } @Override public void onViewCreated(View view, Bundle sis) { super.onViewCreated(view, sis); mScrollView = findView(R.id.scroll_view); // generate mock items final Context context = getContext(); final LayoutInflater inflater = LayoutInflater.from(context); final LinearLayout linearLayout = findView(mScrollView, R.id.linear_layout); final ViewTypeItem viewTypeItem = new ViewTypeItem(); ViewTypeItem.ItemHolder holder;
for (String item: ItemsGenerator.generate(33)) {
noties/Scrollable
sample/src/main/java/ru/noties/scrollable/sample/SampleHeaderView.java
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewUtils.java // public class ViewUtils { // // private ViewUtils() {} // // public static <V extends View> V findView(Activity activity, @IdRes int id) { // //noinspection unchecked // return (V) activity.findViewById(id); // } // // public static <V extends View> V findView(View view, @IdRes int id) { // //noinspection unchecked // return (V) view.findViewById(id); // } // // public static void removeOnGlobalLayoutListener(View view, ViewTreeObserver.OnGlobalLayoutListener listener) { // final ViewTreeObserver observer = view.getViewTreeObserver(); // if (Build.VERSION.SDK_INT >= 16) { // // } else { // //noinspection deprecation // observer.removeGlobalOnLayoutListener(listener); // } // } // }
import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.FrameLayout; import android.widget.TextView; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewUtils;
package ru.noties.scrollable.sample; public class SampleHeaderView extends FrameLayout { private TextView mTextView; private int mCollapsedColor; private int mExpandedColor; public SampleHeaderView(Context context) { this(context, null); } public SampleHeaderView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public SampleHeaderView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs); } private void init(Context context, AttributeSet attributeSet) { inflate(context, R.layout.view_sample_header, this);
// Path: sample/src/main/java/ru/noties/scrollable/sample/ViewUtils.java // public class ViewUtils { // // private ViewUtils() {} // // public static <V extends View> V findView(Activity activity, @IdRes int id) { // //noinspection unchecked // return (V) activity.findViewById(id); // } // // public static <V extends View> V findView(View view, @IdRes int id) { // //noinspection unchecked // return (V) view.findViewById(id); // } // // public static void removeOnGlobalLayoutListener(View view, ViewTreeObserver.OnGlobalLayoutListener listener) { // final ViewTreeObserver observer = view.getViewTreeObserver(); // if (Build.VERSION.SDK_INT >= 16) { // // } else { // //noinspection deprecation // observer.removeGlobalOnLayoutListener(listener); // } // } // } // Path: sample/src/main/java/ru/noties/scrollable/sample/SampleHeaderView.java import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.FrameLayout; import android.widget.TextView; import ru.noties.scrollable.sample.R; import ru.noties.scrollable.sample.ViewUtils; package ru.noties.scrollable.sample; public class SampleHeaderView extends FrameLayout { private TextView mTextView; private int mCollapsedColor; private int mExpandedColor; public SampleHeaderView(Context context) { this(context, null); } public SampleHeaderView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public SampleHeaderView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs); } private void init(Context context, AttributeSet attributeSet) { inflate(context, R.layout.view_sample_header, this);
mTextView = ViewUtils.findView(this, R.id.text_view);
TreyRuffy/TreysDoubleJump
TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/util/UpdateManager.java
// Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/TreysDoubleJump.java // public class TreysDoubleJump extends JavaPlugin implements Listener { // // private static TreysDoubleJump instance; // // private static BukkitAudiences adventure; // // public static TreysDoubleJump getInstance() { // return instance; // } // // public static File dataFolder; // // private static boolean canUseHex = false; // // // Sets up everything // @Override // public void onEnable() { // instance = this; // adventure = BukkitAudiences.create(this); // ConfigManager.reloadConfig(); // dataFolder = getDataFolder(); // new UpdateManager().setup(); // setUseHexCode(); // PluginManager pm = Bukkit.getPluginManager(); // pm.registerEvents(this, this); // pm.registerEvents(new Updates(), this); // pm.registerEvents(new DoubleJump(), this); // pm.registerEvents(new NoFallDamage(), this); // pm.registerEvents(new PlayerWorldSwitchEvent(), this); // // Objects.requireNonNull(getCommand("fly")).setExecutor(new FlightCommand()); // Objects.requireNonNull(getCommand("tdj")).setExecutor(new DoubleJumpCommand()); // Objects.requireNonNull(getCommand("djreload")).setExecutor(new DoubleJumpCommand()); // Objects.requireNonNull(getCommand("groundpound")).setExecutor(new GroundPoundCommand()); // // if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")){ // new PAPI(this).register(); // } // if (ConfigManager.getConfig().getBoolean("Metrics.Enabled")) { // new Metrics(this, 1848); // } // // String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]; // if ((version.equals("v1_8_R1")||version.equals("v1_8_R2")||version.equals("v1_8_R3"))){ // String s = ConfigManager.getConfig().getString("Sounds.Type"); // assert s != null; // if (s.contains("BLOCK_")||s.contains("ENTITY_")){ // String t = s.replace("BLOCK_", "").replace("ENTITY_", ""); // ConfigManager.getConfig().set("Sounds.Type", t); // ConfigManager.saveConfig(); // } // } // Updates.updateCheck(); // } // // public static boolean canUseHexColorCode() { // return canUseHex; // } // // private static void setUseHexCode() { // String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]; // boolean useHex = false; // switch (version) { // case "v1_8_R1": // case "v1_8_R2": // case "v1_8_R3": // case "v1_9_R1": // case "v1_9_R2": // case "v1_10_R1": // case "v1_11_R1": // case "v1_12_R1": // case "v1_13_R1": // case "v1_13_R2": // case "v1_14_R1": // case "v1_15_R1": // break; // case "v1_16_R1": // case "v1_16_R2": // case "v1_16_R3": // useHex = true; // break; // default: // if (version.substring(3).startsWith("1")) { // useHex = true; // } // break; // } // canUseHex = useHex; // } // // public static @NotNull BukkitAudiences adventure() { // if (adventure == null) { // throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!"); // } // return adventure; // } // }
import me.treyruffy.treysdoublejump.TreysDoubleJump; import org.apache.commons.io.FileUtils; import org.bukkit.configuration.ConfigurationSection; import java.io.File; import java.io.IOException; import java.util.Objects;
package me.treyruffy.treysdoublejump.util; /** * Created by TreyRuffy on 08/12/2018. */ public class UpdateManager { // Updates the config public void setup() { if (ConfigManager.getConfig().getString("Version") == null) {
// Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/TreysDoubleJump.java // public class TreysDoubleJump extends JavaPlugin implements Listener { // // private static TreysDoubleJump instance; // // private static BukkitAudiences adventure; // // public static TreysDoubleJump getInstance() { // return instance; // } // // public static File dataFolder; // // private static boolean canUseHex = false; // // // Sets up everything // @Override // public void onEnable() { // instance = this; // adventure = BukkitAudiences.create(this); // ConfigManager.reloadConfig(); // dataFolder = getDataFolder(); // new UpdateManager().setup(); // setUseHexCode(); // PluginManager pm = Bukkit.getPluginManager(); // pm.registerEvents(this, this); // pm.registerEvents(new Updates(), this); // pm.registerEvents(new DoubleJump(), this); // pm.registerEvents(new NoFallDamage(), this); // pm.registerEvents(new PlayerWorldSwitchEvent(), this); // // Objects.requireNonNull(getCommand("fly")).setExecutor(new FlightCommand()); // Objects.requireNonNull(getCommand("tdj")).setExecutor(new DoubleJumpCommand()); // Objects.requireNonNull(getCommand("djreload")).setExecutor(new DoubleJumpCommand()); // Objects.requireNonNull(getCommand("groundpound")).setExecutor(new GroundPoundCommand()); // // if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")){ // new PAPI(this).register(); // } // if (ConfigManager.getConfig().getBoolean("Metrics.Enabled")) { // new Metrics(this, 1848); // } // // String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]; // if ((version.equals("v1_8_R1")||version.equals("v1_8_R2")||version.equals("v1_8_R3"))){ // String s = ConfigManager.getConfig().getString("Sounds.Type"); // assert s != null; // if (s.contains("BLOCK_")||s.contains("ENTITY_")){ // String t = s.replace("BLOCK_", "").replace("ENTITY_", ""); // ConfigManager.getConfig().set("Sounds.Type", t); // ConfigManager.saveConfig(); // } // } // Updates.updateCheck(); // } // // public static boolean canUseHexColorCode() { // return canUseHex; // } // // private static void setUseHexCode() { // String version = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]; // boolean useHex = false; // switch (version) { // case "v1_8_R1": // case "v1_8_R2": // case "v1_8_R3": // case "v1_9_R1": // case "v1_9_R2": // case "v1_10_R1": // case "v1_11_R1": // case "v1_12_R1": // case "v1_13_R1": // case "v1_13_R2": // case "v1_14_R1": // case "v1_15_R1": // break; // case "v1_16_R1": // case "v1_16_R2": // case "v1_16_R3": // useHex = true; // break; // default: // if (version.substring(3).startsWith("1")) { // useHex = true; // } // break; // } // canUseHex = useHex; // } // // public static @NotNull BukkitAudiences adventure() { // if (adventure == null) { // throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!"); // } // return adventure; // } // } // Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/util/UpdateManager.java import me.treyruffy.treysdoublejump.TreysDoubleJump; import org.apache.commons.io.FileUtils; import org.bukkit.configuration.ConfigurationSection; import java.io.File; import java.io.IOException; import java.util.Objects; package me.treyruffy.treysdoublejump.util; /** * Created by TreyRuffy on 08/12/2018. */ public class UpdateManager { // Updates the config public void setup() { if (ConfigManager.getConfig().getString("Version") == null) {
ConfigManager.getConfig().set("Version", TreysDoubleJump.getInstance().getDescription().getVersion());
TreyRuffy/TreysDoubleJump
TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/events/NoFallDamage.java
// Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/util/ConfigManager.java // public class ConfigManager { // // // Accesses the main class // private static final TreysDoubleJump plugin = TreysDoubleJump.getInstance(); // // // Accesses the configuration // public static FileConfiguration MainConfig; // // // Accesses the configuration file // public static File MainConfigFile; // // // Gets the config // public static FileConfiguration getConfig() { // if (MainConfig == null) { // reloadConfig(); // } // return MainConfig; // } // // // Saves the config // public static void saveConfig() { // if (MainConfig == null) { // throw new NullArgumentException("Cannot save a non-existent file!"); // } // try { // MainConfig.save(MainConfigFile); // } catch (IOException e) { // Bukkit.getServer().getLogger().log(Level.SEVERE, "Could not save " + MainConfigFile + ".", e); // } // } // // // Reloads the config // public static void reloadConfig() { // MainConfigFile = new File(plugin.getDataFolder(), "config.yml"); // if (!MainConfigFile.exists()) { // plugin.saveResource("config.yml", false); // } // MainConfig = YamlConfiguration.loadConfiguration(MainConfigFile); // InputStream configData = plugin.getResource("config.yml"); // if (configData != null) { // MainConfig.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(configData))); // } // } // // public static Component getConfigMessage(String message) { // String oldConfigMessage = getOldConfigMessage(message); // return MiniMessage.get().parse(oldConfigMessage); // } // // private static String getOldConfigMessage(String message) { // String messageFromConfig = getConfig().getString("Messages." + message); // if (messageFromConfig == null) { // return ChatColor.RED + "Messages. " + message + " is not set in the config."; // } // if (TreysDoubleJump.canUseHexColorCode()) { // messageFromConfig = translateHexCodes(messageFromConfig); // } // return ChatColor.translateAlternateColorCodes('&', messageFromConfig); // } // // static final Pattern hexPattern = Pattern.compile("#([A-Fa-f0-9]{6})"); // static final char COLOR_CHAR = ChatColor.COLOR_CHAR; // // // Thank you https://www.spigotmc.org/threads/hex-color-code-translate.449748/#post-3867804 // public static String translateHexCodes(String text) { // Matcher matcher = hexPattern.matcher(text); // StringBuffer buffer = new StringBuffer(text.length() + 4 * 8); // while (matcher.find()) // { // String group = matcher.group(1); // matcher.appendReplacement(buffer, COLOR_CHAR + "x" // + COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1) // + COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3) // + COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5) // ); // } // return matcher.appendTail(buffer).toString(); // } // }
import me.treyruffy.treysdoublejump.util.ConfigManager; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
package me.treyruffy.treysdoublejump.events; /** * Created by TreyRuffy on 08/12/2018. */ public class NoFallDamage implements Listener { // Cancels damage if no fall is enabled @EventHandler(priority = EventPriority.HIGH) public void noFall(EntityDamageEvent e) { if ((!e.getCause().equals(DamageCause.FALL))) { return; }
// Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/util/ConfigManager.java // public class ConfigManager { // // // Accesses the main class // private static final TreysDoubleJump plugin = TreysDoubleJump.getInstance(); // // // Accesses the configuration // public static FileConfiguration MainConfig; // // // Accesses the configuration file // public static File MainConfigFile; // // // Gets the config // public static FileConfiguration getConfig() { // if (MainConfig == null) { // reloadConfig(); // } // return MainConfig; // } // // // Saves the config // public static void saveConfig() { // if (MainConfig == null) { // throw new NullArgumentException("Cannot save a non-existent file!"); // } // try { // MainConfig.save(MainConfigFile); // } catch (IOException e) { // Bukkit.getServer().getLogger().log(Level.SEVERE, "Could not save " + MainConfigFile + ".", e); // } // } // // // Reloads the config // public static void reloadConfig() { // MainConfigFile = new File(plugin.getDataFolder(), "config.yml"); // if (!MainConfigFile.exists()) { // plugin.saveResource("config.yml", false); // } // MainConfig = YamlConfiguration.loadConfiguration(MainConfigFile); // InputStream configData = plugin.getResource("config.yml"); // if (configData != null) { // MainConfig.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(configData))); // } // } // // public static Component getConfigMessage(String message) { // String oldConfigMessage = getOldConfigMessage(message); // return MiniMessage.get().parse(oldConfigMessage); // } // // private static String getOldConfigMessage(String message) { // String messageFromConfig = getConfig().getString("Messages." + message); // if (messageFromConfig == null) { // return ChatColor.RED + "Messages. " + message + " is not set in the config."; // } // if (TreysDoubleJump.canUseHexColorCode()) { // messageFromConfig = translateHexCodes(messageFromConfig); // } // return ChatColor.translateAlternateColorCodes('&', messageFromConfig); // } // // static final Pattern hexPattern = Pattern.compile("#([A-Fa-f0-9]{6})"); // static final char COLOR_CHAR = ChatColor.COLOR_CHAR; // // // Thank you https://www.spigotmc.org/threads/hex-color-code-translate.449748/#post-3867804 // public static String translateHexCodes(String text) { // Matcher matcher = hexPattern.matcher(text); // StringBuffer buffer = new StringBuffer(text.length() + 4 * 8); // while (matcher.find()) // { // String group = matcher.group(1); // matcher.appendReplacement(buffer, COLOR_CHAR + "x" // + COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1) // + COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3) // + COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5) // ); // } // return matcher.appendTail(buffer).toString(); // } // } // Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/events/NoFallDamage.java import me.treyruffy.treysdoublejump.util.ConfigManager; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; package me.treyruffy.treysdoublejump.events; /** * Created by TreyRuffy on 08/12/2018. */ public class NoFallDamage implements Listener { // Cancels damage if no fall is enabled @EventHandler(priority = EventPriority.HIGH) public void noFall(EntityDamageEvent e) { if ((!e.getCause().equals(DamageCause.FALL))) { return; }
if (!ConfigManager.getConfig().getBoolean("NoFall.Enabled")) {
TreyRuffy/TreysDoubleJump
TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/Particle_1_16_R3.java
// Path: NmsReference/src/main/java/me/treyruffy/treysdoublejump/nmsreference/ParticlesMain.java // public interface ParticlesMain { // // // Interface for all versions 1.8 - 1.16.4+ // void sendParticle(Player p, String particle, Location loc, int amount, float r, float g, float b); // // } // // Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/util/ConfigManager.java // public class ConfigManager { // // // Accesses the main class // private static final TreysDoubleJump plugin = TreysDoubleJump.getInstance(); // // // Accesses the configuration // public static FileConfiguration MainConfig; // // // Accesses the configuration file // public static File MainConfigFile; // // // Gets the config // public static FileConfiguration getConfig() { // if (MainConfig == null) { // reloadConfig(); // } // return MainConfig; // } // // // Saves the config // public static void saveConfig() { // if (MainConfig == null) { // throw new NullArgumentException("Cannot save a non-existent file!"); // } // try { // MainConfig.save(MainConfigFile); // } catch (IOException e) { // Bukkit.getServer().getLogger().log(Level.SEVERE, "Could not save " + MainConfigFile + ".", e); // } // } // // // Reloads the config // public static void reloadConfig() { // MainConfigFile = new File(plugin.getDataFolder(), "config.yml"); // if (!MainConfigFile.exists()) { // plugin.saveResource("config.yml", false); // } // MainConfig = YamlConfiguration.loadConfiguration(MainConfigFile); // InputStream configData = plugin.getResource("config.yml"); // if (configData != null) { // MainConfig.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(configData))); // } // } // // public static Component getConfigMessage(String message) { // String oldConfigMessage = getOldConfigMessage(message); // return MiniMessage.get().parse(oldConfigMessage); // } // // private static String getOldConfigMessage(String message) { // String messageFromConfig = getConfig().getString("Messages." + message); // if (messageFromConfig == null) { // return ChatColor.RED + "Messages. " + message + " is not set in the config."; // } // if (TreysDoubleJump.canUseHexColorCode()) { // messageFromConfig = translateHexCodes(messageFromConfig); // } // return ChatColor.translateAlternateColorCodes('&', messageFromConfig); // } // // static final Pattern hexPattern = Pattern.compile("#([A-Fa-f0-9]{6})"); // static final char COLOR_CHAR = ChatColor.COLOR_CHAR; // // // Thank you https://www.spigotmc.org/threads/hex-color-code-translate.449748/#post-3867804 // public static String translateHexCodes(String text) { // Matcher matcher = hexPattern.matcher(text); // StringBuffer buffer = new StringBuffer(text.length() + 4 * 8); // while (matcher.find()) // { // String group = matcher.group(1); // matcher.appendReplacement(buffer, COLOR_CHAR + "x" // + COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1) // + COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3) // + COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5) // ); // } // return matcher.appendTail(buffer).toString(); // } // }
import me.treyruffy.treysdoublejump.nmsreference.ParticlesMain; import me.treyruffy.treysdoublejump.util.ConfigManager; import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Particle; import org.bukkit.entity.Player;
package me.treyruffy.treysdoublejump; /** * Created by TreyRuffy on 01/26/2020. */ public class Particle_1_16_R3 implements ParticlesMain { // Sets particles for 1.16.4+ @Override public void sendParticle(Player p, String particle, Location loc, int amount, float r, float g, float b) {
// Path: NmsReference/src/main/java/me/treyruffy/treysdoublejump/nmsreference/ParticlesMain.java // public interface ParticlesMain { // // // Interface for all versions 1.8 - 1.16.4+ // void sendParticle(Player p, String particle, Location loc, int amount, float r, float g, float b); // // } // // Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/util/ConfigManager.java // public class ConfigManager { // // // Accesses the main class // private static final TreysDoubleJump plugin = TreysDoubleJump.getInstance(); // // // Accesses the configuration // public static FileConfiguration MainConfig; // // // Accesses the configuration file // public static File MainConfigFile; // // // Gets the config // public static FileConfiguration getConfig() { // if (MainConfig == null) { // reloadConfig(); // } // return MainConfig; // } // // // Saves the config // public static void saveConfig() { // if (MainConfig == null) { // throw new NullArgumentException("Cannot save a non-existent file!"); // } // try { // MainConfig.save(MainConfigFile); // } catch (IOException e) { // Bukkit.getServer().getLogger().log(Level.SEVERE, "Could not save " + MainConfigFile + ".", e); // } // } // // // Reloads the config // public static void reloadConfig() { // MainConfigFile = new File(plugin.getDataFolder(), "config.yml"); // if (!MainConfigFile.exists()) { // plugin.saveResource("config.yml", false); // } // MainConfig = YamlConfiguration.loadConfiguration(MainConfigFile); // InputStream configData = plugin.getResource("config.yml"); // if (configData != null) { // MainConfig.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(configData))); // } // } // // public static Component getConfigMessage(String message) { // String oldConfigMessage = getOldConfigMessage(message); // return MiniMessage.get().parse(oldConfigMessage); // } // // private static String getOldConfigMessage(String message) { // String messageFromConfig = getConfig().getString("Messages." + message); // if (messageFromConfig == null) { // return ChatColor.RED + "Messages. " + message + " is not set in the config."; // } // if (TreysDoubleJump.canUseHexColorCode()) { // messageFromConfig = translateHexCodes(messageFromConfig); // } // return ChatColor.translateAlternateColorCodes('&', messageFromConfig); // } // // static final Pattern hexPattern = Pattern.compile("#([A-Fa-f0-9]{6})"); // static final char COLOR_CHAR = ChatColor.COLOR_CHAR; // // // Thank you https://www.spigotmc.org/threads/hex-color-code-translate.449748/#post-3867804 // public static String translateHexCodes(String text) { // Matcher matcher = hexPattern.matcher(text); // StringBuffer buffer = new StringBuffer(text.length() + 4 * 8); // while (matcher.find()) // { // String group = matcher.group(1); // matcher.appendReplacement(buffer, COLOR_CHAR + "x" // + COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1) // + COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3) // + COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5) // ); // } // return matcher.appendTail(buffer).toString(); // } // } // Path: TreysDoubleJump/src/main/java/me/treyruffy/treysdoublejump/Particle_1_16_R3.java import me.treyruffy.treysdoublejump.nmsreference.ParticlesMain; import me.treyruffy.treysdoublejump.util.ConfigManager; import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Particle; import org.bukkit.entity.Player; package me.treyruffy.treysdoublejump; /** * Created by TreyRuffy on 01/26/2020. */ public class Particle_1_16_R3 implements ParticlesMain { // Sets particles for 1.16.4+ @Override public void sendParticle(Player p, String particle, Location loc, int amount, float r, float g, float b) {
if (ConfigManager.getConfig().getBoolean("Particles.AllPlayers")) {
berry-cs/big-data-cse
big-data-java/src/easy/data/xml/SubFieldCollector.java
// Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // }
import java.util.HashMap; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField;
package easy.data.xml; /** * When applied to a data field, it takes all subfields of that data field, * and adds them as a top-level field to the targetfield, with the given path. * If 'toplevel' is true, it skips primitive and list fields in the process. * If 'wraplist' is true, it wraps any fields as a list when adding them to * targetfield. */ public class SubFieldCollector implements IDFVisitor<Void> { CompField targetField; String prefix; boolean topLevel; boolean wrapList; public SubFieldCollector(CompField targetField, String prefix) { this(targetField, prefix, true, false); } public SubFieldCollector(CompField targetField, String prefix, boolean topLevel, boolean wrapList) { this.targetField = targetField; this.prefix = prefix; this.topLevel = topLevel; this.wrapList = wrapList; }
// Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // } // Path: big-data-java/src/easy/data/xml/SubFieldCollector.java import java.util.HashMap; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField; package easy.data.xml; /** * When applied to a data field, it takes all subfields of that data field, * and adds them as a top-level field to the targetfield, with the given path. * If 'toplevel' is true, it skips primitive and list fields in the process. * If 'wraplist' is true, it wraps any fields as a list when adding them to * targetfield. */ public class SubFieldCollector implements IDFVisitor<Void> { CompField targetField; String prefix; boolean topLevel; boolean wrapList; public SubFieldCollector(CompField targetField, String prefix) { this(targetField, prefix, true, false); } public SubFieldCollector(CompField targetField, String prefix, boolean topLevel, boolean wrapList) { this.targetField = targetField; this.prefix = prefix; this.topLevel = topLevel; this.wrapList = wrapList; }
public Void defaultVisit(IDataField df) {
berry-cs/big-data-cse
big-data-java/src/easy/data/xml/SubFieldCollector.java
// Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // }
import java.util.HashMap; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField;
package easy.data.xml; /** * When applied to a data field, it takes all subfields of that data field, * and adds them as a top-level field to the targetfield, with the given path. * If 'toplevel' is true, it skips primitive and list fields in the process. * If 'wraplist' is true, it wraps any fields as a list when adding them to * targetfield. */ public class SubFieldCollector implements IDFVisitor<Void> { CompField targetField; String prefix; boolean topLevel; boolean wrapList; public SubFieldCollector(CompField targetField, String prefix) { this(targetField, prefix, true, false); } public SubFieldCollector(CompField targetField, String prefix, boolean topLevel, boolean wrapList) { this.targetField = targetField; this.prefix = prefix; this.topLevel = topLevel; this.wrapList = wrapList; } public Void defaultVisit(IDataField df) { throw new RuntimeException("Unhandled"); }
// Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // } // Path: big-data-java/src/easy/data/xml/SubFieldCollector.java import java.util.HashMap; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField; package easy.data.xml; /** * When applied to a data field, it takes all subfields of that data field, * and adds them as a top-level field to the targetfield, with the given path. * If 'toplevel' is true, it skips primitive and list fields in the process. * If 'wraplist' is true, it wraps any fields as a list when adding them to * targetfield. */ public class SubFieldCollector implements IDFVisitor<Void> { CompField targetField; String prefix; boolean topLevel; boolean wrapList; public SubFieldCollector(CompField targetField, String prefix) { this(targetField, prefix, true, false); } public SubFieldCollector(CompField targetField, String prefix, boolean topLevel, boolean wrapList) { this.targetField = targetField; this.prefix = prefix; this.topLevel = topLevel; this.wrapList = wrapList; } public Void defaultVisit(IDataField df) { throw new RuntimeException("Unhandled"); }
public Void visitPrimField(PrimField f, String basePath, String description) {
berry-cs/big-data-cse
big-data-java/src/easy/data/xml/SubFieldCollector.java
// Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // }
import java.util.HashMap; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField;
package easy.data.xml; /** * When applied to a data field, it takes all subfields of that data field, * and adds them as a top-level field to the targetfield, with the given path. * If 'toplevel' is true, it skips primitive and list fields in the process. * If 'wraplist' is true, it wraps any fields as a list when adding them to * targetfield. */ public class SubFieldCollector implements IDFVisitor<Void> { CompField targetField; String prefix; boolean topLevel; boolean wrapList; public SubFieldCollector(CompField targetField, String prefix) { this(targetField, prefix, true, false); } public SubFieldCollector(CompField targetField, String prefix, boolean topLevel, boolean wrapList) { this.targetField = targetField; this.prefix = prefix; this.topLevel = topLevel; this.wrapList = wrapList; } public Void defaultVisit(IDataField df) { throw new RuntimeException("Unhandled"); } public Void visitPrimField(PrimField f, String basePath, String description) { if (!topLevel) { //System.out.println(prefix); IDataField newfield; if (wrapList) {
// Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // } // Path: big-data-java/src/easy/data/xml/SubFieldCollector.java import java.util.HashMap; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField; package easy.data.xml; /** * When applied to a data field, it takes all subfields of that data field, * and adds them as a top-level field to the targetfield, with the given path. * If 'toplevel' is true, it skips primitive and list fields in the process. * If 'wraplist' is true, it wraps any fields as a list when adding them to * targetfield. */ public class SubFieldCollector implements IDFVisitor<Void> { CompField targetField; String prefix; boolean topLevel; boolean wrapList; public SubFieldCollector(CompField targetField, String prefix) { this(targetField, prefix, true, false); } public SubFieldCollector(CompField targetField, String prefix, boolean topLevel, boolean wrapList) { this.targetField = targetField; this.prefix = prefix; this.topLevel = topLevel; this.wrapList = wrapList; } public Void defaultVisit(IDataField df) { throw new RuntimeException("Unhandled"); } public Void visitPrimField(PrimField f, String basePath, String description) { if (!topLevel) { //System.out.println(prefix); IDataField newfield; if (wrapList) {
newfield = new ListField(null, prefix, new PrimField(null));
berry-cs/big-data-cse
big-data-java/src/easy/data/sig/CompSig.java
// Path: big-data-java/src/easy/data/util/ProcessingDetector.java // public class ProcessingDetector { // final public static Class<?> pappletClass = getPappletClass(); // private static Object pappletObject = null; // // public static boolean inProcessing() { // return pappletClass != null; // } // // private static Class<?> getPappletClass() { // try { // return Class.forName("processing.core.PApplet"); // } catch (ClassNotFoundException e) { // return null; // } // } // // public static void setPappletObject(Object o) { // if (pappletClass != null && pappletClass.isAssignableFrom(o.getClass())) { // pappletObject = o; // } // // TODO: add error checking here... // } // // public static Object getPapplet() { // return pappletObject; // } // // public static String sketchPath(String file) { // if (inProcessing() && pappletObject != null) { // try { // Method m = pappletClass.getMethod("sketchPath", String.class); // m.setAccessible(true); // return (String)m.invoke(pappletObject, file); // } catch (NoSuchMethodException e) { // e.printStackTrace(); // } catch (SecurityException e) { // e.printStackTrace(); // } catch (IllegalAccessException e) { // e.printStackTrace(); // } catch (IllegalArgumentException e) { // e.printStackTrace(); // } catch (InvocationTargetException e) { // e.printStackTrace(); // } // } // return null; // } // // public static String getProcessingSketchClassName() { // StackTraceElement[] es = Thread.currentThread().getStackTrace(); // String appletName = null; // for (int i = 0; i < es.length; i++) { // if (es[i].getClassName().equals("processing.core.PApplet") && i > 0) { // appletName = es[i-1].getClassName(); // break; // } // } // return appletName; // } // // public static String tryToFixPath(String path) { // if (!inProcessing() || URLPrepper.isURL(path)) return path; // // File f = new File(path); // if (!f.exists() && !f.isAbsolute()) { // String try1 = tryToFixPath(sketchPath(path)); // if (try1.equals(path)) // didn't do anything // return tryToFixPath(sketchPath("data/" + path)); // else // return try1; // } // // return path; // } // }
import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.util.ArrayList; import easy.data.util.ProcessingDetector;
* * @return */ @SuppressWarnings("unchecked") public Constructor<C> findConstructor() { try { Constructor<C>[] constrs = (Constructor<C>[]) cls.getDeclaredConstructors(); Constructor<C> theCons = null; for (Constructor<C> cr : constrs) { int m = cr.getModifiers(); if (Modifier.isPrivate(m) || Modifier.isProtected(m)) continue; //System.err.println(" >> Checking " + this + " with " + cr); if (this.unifiesWithConstructor(cr, false) || this.unifiesWithConstructor(cr, true)) { //System.err.println(" >> OK"); theCons = cr; break; } } return theCons; } catch (SecurityException e) { System.out.println(e.getMessage()); e.printStackTrace(); } return null; } private boolean unifiesWithConstructor(Constructor<C> cr, boolean processingCompatible) { Class<?>[] paramTys = cr.getParameterTypes(); int start = 0;
// Path: big-data-java/src/easy/data/util/ProcessingDetector.java // public class ProcessingDetector { // final public static Class<?> pappletClass = getPappletClass(); // private static Object pappletObject = null; // // public static boolean inProcessing() { // return pappletClass != null; // } // // private static Class<?> getPappletClass() { // try { // return Class.forName("processing.core.PApplet"); // } catch (ClassNotFoundException e) { // return null; // } // } // // public static void setPappletObject(Object o) { // if (pappletClass != null && pappletClass.isAssignableFrom(o.getClass())) { // pappletObject = o; // } // // TODO: add error checking here... // } // // public static Object getPapplet() { // return pappletObject; // } // // public static String sketchPath(String file) { // if (inProcessing() && pappletObject != null) { // try { // Method m = pappletClass.getMethod("sketchPath", String.class); // m.setAccessible(true); // return (String)m.invoke(pappletObject, file); // } catch (NoSuchMethodException e) { // e.printStackTrace(); // } catch (SecurityException e) { // e.printStackTrace(); // } catch (IllegalAccessException e) { // e.printStackTrace(); // } catch (IllegalArgumentException e) { // e.printStackTrace(); // } catch (InvocationTargetException e) { // e.printStackTrace(); // } // } // return null; // } // // public static String getProcessingSketchClassName() { // StackTraceElement[] es = Thread.currentThread().getStackTrace(); // String appletName = null; // for (int i = 0; i < es.length; i++) { // if (es[i].getClassName().equals("processing.core.PApplet") && i > 0) { // appletName = es[i-1].getClassName(); // break; // } // } // return appletName; // } // // public static String tryToFixPath(String path) { // if (!inProcessing() || URLPrepper.isURL(path)) return path; // // File f = new File(path); // if (!f.exists() && !f.isAbsolute()) { // String try1 = tryToFixPath(sketchPath(path)); // if (try1.equals(path)) // didn't do anything // return tryToFixPath(sketchPath("data/" + path)); // else // return try1; // } // // return path; // } // } // Path: big-data-java/src/easy/data/sig/CompSig.java import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.util.ArrayList; import easy.data.util.ProcessingDetector; * * @return */ @SuppressWarnings("unchecked") public Constructor<C> findConstructor() { try { Constructor<C>[] constrs = (Constructor<C>[]) cls.getDeclaredConstructors(); Constructor<C> theCons = null; for (Constructor<C> cr : constrs) { int m = cr.getModifiers(); if (Modifier.isPrivate(m) || Modifier.isProtected(m)) continue; //System.err.println(" >> Checking " + this + " with " + cr); if (this.unifiesWithConstructor(cr, false) || this.unifiesWithConstructor(cr, true)) { //System.err.println(" >> OK"); theCons = cr; break; } } return theCons; } catch (SecurityException e) { System.out.println(e.getMessage()); e.printStackTrace(); } return null; } private boolean unifiesWithConstructor(Constructor<C> cr, boolean processingCompatible) { Class<?>[] paramTys = cr.getParameterTypes(); int start = 0;
if (processingCompatible && ProcessingDetector.inProcessing() && paramTys.length > 0
berry-cs/big-data-cse
big-data-java/src/easy/data/tests/ISigTests.java
// Path: big-data-java/src/easy/data/sig/PrimSig.java // public class PrimSig implements ISig { // public static final PrimSig BOOLEAN_SIG = new PrimSig("boolean", false); // public static final PrimSig BYTE_SIG = new PrimSig("byte", 0); // public static final PrimSig CHAR_SIG = new PrimSig("char", 0); // public static final PrimSig DOUBLE_SIG = new PrimSig("double", 0.0); // public static final PrimSig FLOAT_SIG = new PrimSig("float", 0.0f); // public static final PrimSig INT_SIG = new PrimSig("int", 0); // public static final PrimSig LONG_SIG = new PrimSig("long", 0); // public static final PrimSig STRING_SIG = new PrimSig("String", ""); // public static final PrimSig WILDCARD_SIG = new PrimSig("?", null); // // private String name; // private Object nullValue; // value to use if a field is parsed null // // protected PrimSig(String name, Object nullValue) { // this.name = name; // this.nullValue = nullValue; // } // // /* (non-Javadoc) // * @see data2.sig.ISig#apply(data2.sig.ISigVisitor) // */ // public <A> A apply(ISigVisitor<A> sv) { // return sv.visit(this); // } // // /* (non-Javadoc) // * @see data2.sig.ISig#unifyWith(java.lang.Class) // * // isig class --> ok/what // anything string -> string // wildcard c -> c_sig // s s -> s // */ // private static HashMap<Class<?>,PrimSig> ctos = setupClassSigMap(); // // public ISig unifyWith(Class<?> c) throws SignatureUnificationException { // if (ArrayUtils.indexOf(new Object[] { Boolean.class, Byte.class, Character.class, Float.class, Integer.class, // Double.class, String.class }, c) == ArrayUtils.INDEX_NOT_FOUND // && !c.isPrimitive()) throw new SignatureUnificationException(c.getName() + " is not a primitive class"); // // PrimSig csig = ctos.get(c); // sig for Class c // //System.out.println("c: " + c + " / csig: " + csig); // if (c == String.class) return STRING_SIG; // else if (this == WILDCARD_SIG) return csig; // else if (this == csig) return csig; // else throw new SignatureUnificationException(this + " cannot be unified with " + c.getName()); // } // // public boolean unifiesWith(Class<?> c) { // try { // return this.unifyWith(c) != null; // } catch (SignatureUnificationException e) { // return false; // } // } // // private static HashMap<Class<?>, PrimSig> setupClassSigMap() { // ctos = new HashMap<Class<?>, PrimSig>(); // ctos.put(Boolean.class, BOOLEAN_SIG); // ctos.put(boolean.class, BOOLEAN_SIG); // ctos.put(Byte.class, BYTE_SIG); // ctos.put(byte.class, BYTE_SIG); // ctos.put(Character.class, CHAR_SIG); // ctos.put(char.class, CHAR_SIG); // ctos.put(Integer.class, INT_SIG); // ctos.put(int.class, INT_SIG); // ctos.put(long.class, LONG_SIG); // ctos.put(Long.class, LONG_SIG); // ctos.put(Double.class, DOUBLE_SIG); // ctos.put(double.class, DOUBLE_SIG); // ctos.put(float.class, FLOAT_SIG); // ctos.put(Float.class, FLOAT_SIG); // ctos.put(String.class, STRING_SIG); // return ctos; // } // // /** // * Produces the name of the primitive type represented by this object // * @return the name of a primitive type // */ // public String getName() { // return name; // } // // public Object getNullValue() { // return nullValue; // } // // @Override // public String toString() { // return "<" + getName() + ">"; // } // // }
import static easy.data.sig.PrimSig.*; import static org.junit.Assert.*; import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Before; import org.junit.Test; import org.junit.rules.ExpectedException; import easy.data.sig.*; import java.util.ArrayList;
package easy.data.tests; public class ISigTests { ArrayList<String> al1; ArrayList<Integer> al2; //ArrayList<Thread> al3; cannot get reflection info about arraylist component type String[] as1; int[] as2; Thread[] as3; ListSig ls1; ListSig ls2; CompSig<C1> cs1; // C1: int * string CompSig<C1> cs2; // C1: int * int CompSig<C1> cs3; // C1: int CompSig<C2> cs4; // C2: int * int static ISigVisitor<Integer> intVisitor = new ISigVisitor<Integer>() { public Integer defaultVisit(ISig s) { return 0; }
// Path: big-data-java/src/easy/data/sig/PrimSig.java // public class PrimSig implements ISig { // public static final PrimSig BOOLEAN_SIG = new PrimSig("boolean", false); // public static final PrimSig BYTE_SIG = new PrimSig("byte", 0); // public static final PrimSig CHAR_SIG = new PrimSig("char", 0); // public static final PrimSig DOUBLE_SIG = new PrimSig("double", 0.0); // public static final PrimSig FLOAT_SIG = new PrimSig("float", 0.0f); // public static final PrimSig INT_SIG = new PrimSig("int", 0); // public static final PrimSig LONG_SIG = new PrimSig("long", 0); // public static final PrimSig STRING_SIG = new PrimSig("String", ""); // public static final PrimSig WILDCARD_SIG = new PrimSig("?", null); // // private String name; // private Object nullValue; // value to use if a field is parsed null // // protected PrimSig(String name, Object nullValue) { // this.name = name; // this.nullValue = nullValue; // } // // /* (non-Javadoc) // * @see data2.sig.ISig#apply(data2.sig.ISigVisitor) // */ // public <A> A apply(ISigVisitor<A> sv) { // return sv.visit(this); // } // // /* (non-Javadoc) // * @see data2.sig.ISig#unifyWith(java.lang.Class) // * // isig class --> ok/what // anything string -> string // wildcard c -> c_sig // s s -> s // */ // private static HashMap<Class<?>,PrimSig> ctos = setupClassSigMap(); // // public ISig unifyWith(Class<?> c) throws SignatureUnificationException { // if (ArrayUtils.indexOf(new Object[] { Boolean.class, Byte.class, Character.class, Float.class, Integer.class, // Double.class, String.class }, c) == ArrayUtils.INDEX_NOT_FOUND // && !c.isPrimitive()) throw new SignatureUnificationException(c.getName() + " is not a primitive class"); // // PrimSig csig = ctos.get(c); // sig for Class c // //System.out.println("c: " + c + " / csig: " + csig); // if (c == String.class) return STRING_SIG; // else if (this == WILDCARD_SIG) return csig; // else if (this == csig) return csig; // else throw new SignatureUnificationException(this + " cannot be unified with " + c.getName()); // } // // public boolean unifiesWith(Class<?> c) { // try { // return this.unifyWith(c) != null; // } catch (SignatureUnificationException e) { // return false; // } // } // // private static HashMap<Class<?>, PrimSig> setupClassSigMap() { // ctos = new HashMap<Class<?>, PrimSig>(); // ctos.put(Boolean.class, BOOLEAN_SIG); // ctos.put(boolean.class, BOOLEAN_SIG); // ctos.put(Byte.class, BYTE_SIG); // ctos.put(byte.class, BYTE_SIG); // ctos.put(Character.class, CHAR_SIG); // ctos.put(char.class, CHAR_SIG); // ctos.put(Integer.class, INT_SIG); // ctos.put(int.class, INT_SIG); // ctos.put(long.class, LONG_SIG); // ctos.put(Long.class, LONG_SIG); // ctos.put(Double.class, DOUBLE_SIG); // ctos.put(double.class, DOUBLE_SIG); // ctos.put(float.class, FLOAT_SIG); // ctos.put(Float.class, FLOAT_SIG); // ctos.put(String.class, STRING_SIG); // return ctos; // } // // /** // * Produces the name of the primitive type represented by this object // * @return the name of a primitive type // */ // public String getName() { // return name; // } // // public Object getNullValue() { // return nullValue; // } // // @Override // public String toString() { // return "<" + getName() + ">"; // } // // } // Path: big-data-java/src/easy/data/tests/ISigTests.java import static easy.data.sig.PrimSig.*; import static org.junit.Assert.*; import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Before; import org.junit.Test; import org.junit.rules.ExpectedException; import easy.data.sig.*; import java.util.ArrayList; package easy.data.tests; public class ISigTests { ArrayList<String> al1; ArrayList<Integer> al2; //ArrayList<Thread> al3; cannot get reflection info about arraylist component type String[] as1; int[] as2; Thread[] as3; ListSig ls1; ListSig ls2; CompSig<C1> cs1; // C1: int * string CompSig<C1> cs2; // C1: int * int CompSig<C1> cs3; // C1: int CompSig<C2> cs4; // C2: int * int static ISigVisitor<Integer> intVisitor = new ISigVisitor<Integer>() { public Integer defaultVisit(ISig s) { return 0; }
public <C> Integer visit(PrimSig s) { return 1; }
berry-cs/big-data-cse
big-data-java/src/easy/data/xml/XMLInstantiator.java
// Path: big-data-java/src/easy/data/DataInstantiationException.java // @SuppressWarnings("serial") // public class DataInstantiationException extends RuntimeException { // public DataInstantiationException(String message) { // super(message); // } // } // // Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // }
import java.lang.reflect.*; import java.util.*; import easy.data.DataInstantiationException; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField; import easy.data.sig.*; import easy.data.util.*;
package easy.data.xml; /** * Attempt to instantiate an object of the given signature * using the structure of the xml data described by the field * to which this visitor is applied * * @author Nadeem Abdul Hamid * */ @SuppressWarnings("unchecked") public class XMLInstantiator<T> implements IDFVisitor<T> { private XML xml; private ISig s; public XMLInstantiator(XML xml, ISig s) { this.xml = xml; this.s = s; }
// Path: big-data-java/src/easy/data/DataInstantiationException.java // @SuppressWarnings("serial") // public class DataInstantiationException extends RuntimeException { // public DataInstantiationException(String message) { // super(message); // } // } // // Path: big-data-java/src/easy/data/field/CompField.java // public class CompField extends ADataField implements IDataField { // private HashMap<String, IDataField> fieldMap; // // public CompField() { // this(null); // } // // public CompField(String basePath) { // this(basePath, null); // } // // public CompField(String basePath, String description) { // super(basePath, description); // this.fieldMap = new HashMap<String, IDataField>(); // } // // public IDataField addField(String name, IDataField fld) { // return fieldMap.put(name, fld); // } // // public String[] fieldNames() { // return fieldMap.keySet().toArray(new String[] {}); // } // // public Collection<IDataField> fields() { // return fieldMap.values(); // } // // public IDataField getField(String name) { // return fieldMap.get(name); // } // // public boolean hasField(String name) { // return fieldMap.containsKey(name); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitCompField(this, this.basePath, this.description, this.fieldMap); // } // // public String toString() { // String m = "{_<" + basePath + "> "; // boolean firstDone = false; // for (String k : fieldNames()) { // if (firstDone) { m += ", "; } else { firstDone = true; } // m += (k + ": " + fieldMap.get(k)); // } // m += "}"; // return m; // } // // } // // Path: big-data-java/src/easy/data/field/IDFVisitor.java // public interface IDFVisitor<T> { // public T defaultVisit(IDataField df); // public T visitPrimField(PrimField f, String basePath, String description); // public T visitCompField(CompField f, String basePath, String description, HashMap<String, IDataField> fieldMap); // public T visitListField(ListField f, String basePath, String description, String elemPath, IDataField elemField); // } // // Path: big-data-java/src/easy/data/field/IDataField.java // public interface IDataField { // public String getDescription(); // public <T> T apply(IDFVisitor<T> fv); // } // // Path: big-data-java/src/easy/data/field/ListField.java // public class ListField extends ADataField implements IDataField { // private String elemPath; // private IDataField elemField; // // public ListField(String basepath, String elempath, IDataField basefld) { // this(basepath, elempath, basefld, null); // } // // public ListField(String basepath, String elemPath, IDataField elemField, String description) { // super(basepath, description); // this.elemPath = elemPath; // this.elemField = elemField; // } // // public String getElemPath() { // return this.elemPath; // } // // public IDataField getElemField() { // return this.elemField; // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitListField(this, this.basePath, this.description, this.elemPath, this.elemField); // } // // public String toString() { // return "[_<" + basePath + "," + elemPath + "> " + elemField + "]"; // } // // } // // Path: big-data-java/src/easy/data/field/PrimField.java // public class PrimField extends ADataField implements IDataField { // public PrimField() { // super(null, null); // } // // public PrimField(String path) { // super(path, null); // } // // public PrimField(String path, String description) { // super(path, description); // } // // public <T> T apply(IDFVisitor<T> fv) { // return fv.visitPrimField(this, this.basePath, this.description); // } // // public String toString() { // return "<" + basePath + ">"; // } // } // Path: big-data-java/src/easy/data/xml/XMLInstantiator.java import java.lang.reflect.*; import java.util.*; import easy.data.DataInstantiationException; import easy.data.field.CompField; import easy.data.field.IDFVisitor; import easy.data.field.IDataField; import easy.data.field.ListField; import easy.data.field.PrimField; import easy.data.sig.*; import easy.data.util.*; package easy.data.xml; /** * Attempt to instantiate an object of the given signature * using the structure of the xml data described by the field * to which this visitor is applied * * @author Nadeem Abdul Hamid * */ @SuppressWarnings("unchecked") public class XMLInstantiator<T> implements IDFVisitor<T> { private XML xml; private ISig s; public XMLInstantiator(XML xml, ISig s) { this.xml = xml; this.s = s; }
public T defaultVisit(IDataField df) {