-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
971ea44
commit 0767ea7
Showing
3 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
javacord-api/src/main/java/org/javacord/api/entity/AttachmentFlag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.javacord.api.entity; | ||
|
||
public enum AttachmentFlag { | ||
/** | ||
* This attachment has been edited using the remix feature on mobile. | ||
*/ | ||
IS_REMIX(1 << 2), | ||
|
||
/** | ||
* The unknown message flag type. | ||
*/ | ||
UNKNOWN(-1); | ||
|
||
private final int id; | ||
|
||
/** | ||
* Creates a new attachment flags type. | ||
* | ||
* @param id attachment flags id. | ||
*/ | ||
AttachmentFlag(final int id) { | ||
this.id = id; | ||
} | ||
|
||
/** | ||
* Gets the id of the attachment flags type. | ||
* | ||
* @return The id of the attachment flags type. | ||
*/ | ||
public int getId() { | ||
return this.id; | ||
} | ||
|
||
/** | ||
* Gets the attashment flags type by its id. | ||
* | ||
* @param id The id of the attachment flag type. | ||
* @return The attachment flag type with the given id or {@link AttachmentFlag#UNKNOWN} if unknown id. | ||
*/ | ||
public static AttachmentFlag getFlagTypeById(final int id) { | ||
for (final AttachmentFlag value : values()) { | ||
if (value.getId() == id) { | ||
return value; | ||
} | ||
} | ||
return UNKNOWN; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters