id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
116,600 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java | NGCommunicator.close | public void close() throws IOException {
if (closed) {
return;
}
closed = true;
stopIn();
stopOut();
// socket streams and socket itself should be already closed with stopIn() and stopOut()
// but because it is idempotent, let's be good citizens and close corresponding streams as wel... | java | public void close() throws IOException {
if (closed) {
return;
}
closed = true;
stopIn();
stopOut();
// socket streams and socket itself should be already closed with stopIn() and stopOut()
// but because it is idempotent, let's be good citizens and close corresponding streams as wel... | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"closed",
")",
"{",
"return",
";",
"}",
"closed",
"=",
"true",
";",
"stopIn",
"(",
")",
";",
"stopOut",
"(",
")",
";",
"// socket streams and socket itself should be already closed w... | Closes communication socket gracefully | [
"Closes",
"communication",
"socket",
"gracefully"
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java#L397-L415 |
116,601 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java | NGCommunicator.readChunk | private byte readChunk() throws IOException {
try {
return readChunkImpl();
} catch (SocketException ex) {
// Some stream implementations may throw SocketException and not EOFException when socket is
// terminated by
// application
// By common agreement, rethrow it as EOFException... | java | private byte readChunk() throws IOException {
try {
return readChunkImpl();
} catch (SocketException ex) {
// Some stream implementations may throw SocketException and not EOFException when socket is
// terminated by
// application
// By common agreement, rethrow it as EOFException... | [
"private",
"byte",
"readChunk",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"readChunkImpl",
"(",
")",
";",
"}",
"catch",
"(",
"SocketException",
"ex",
")",
"{",
"// Some stream implementations may throw SocketException and not EOFException when socket i... | Reads a NailGun chunk header from the underlying InputStream.
@return type of chunk received
@throws EOFException if underlying stream / socket is closed which happens on client
disconnection or server closure
@throws IOException if thrown by the underlying InputStream, or if an unexpected NailGun chunk
type is encoun... | [
"Reads",
"a",
"NailGun",
"chunk",
"header",
"from",
"the",
"underlying",
"InputStream",
"."
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java#L482-L499 |
116,602 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java | NGCommunicator.receive | int receive(byte[] b, int offset, int length) throws IOException, InterruptedException {
synchronized (readLock) {
if (remaining > 0) {
int bytesToRead = Math.min(remaining, length);
int result = stdin.read(b, offset, bytesToRead);
remaining -= result;
return result;
}
... | java | int receive(byte[] b, int offset, int length) throws IOException, InterruptedException {
synchronized (readLock) {
if (remaining > 0) {
int bytesToRead = Math.min(remaining, length);
int result = stdin.read(b, offset, bytesToRead);
remaining -= result;
return result;
}
... | [
"int",
"receive",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"synchronized",
"(",
"readLock",
")",
"{",
"if",
"(",
"remaining",
">",
"0",
")",
"{",
"int",
"byt... | Read data from client's stdin. This function blocks till input is received from the client.
@return number of bytes read or -1 if no more data is available
@throws IOException in case of socket error | [
"Read",
"data",
"from",
"client",
"s",
"stdin",
".",
"This",
"function",
"blocks",
"till",
"input",
"is",
"received",
"from",
"the",
"client",
"."
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java#L553-L579 |
116,603 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java | NGCommunicator.send | void send(byte streamCode, byte[] b, int offset, int len) throws IOException {
synchronized (writeLock) {
out.writeInt(len);
out.writeByte(streamCode);
out.write(b, offset, len);
}
out.flush();
} | java | void send(byte streamCode, byte[] b, int offset, int len) throws IOException {
synchronized (writeLock) {
out.writeInt(len);
out.writeByte(streamCode);
out.write(b, offset, len);
}
out.flush();
} | [
"void",
"send",
"(",
"byte",
"streamCode",
",",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"writeLock",
")",
"{",
"out",
".",
"writeInt",
"(",
"len",
")",
";",
"out",
".",
... | Send data to the client | [
"Send",
"data",
"to",
"the",
"client"
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java#L582-L589 |
116,604 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java | NGCommunicator.notifyHeartbeat | private void notifyHeartbeat() {
ArrayList<NGHeartbeatListener> listeners;
synchronized (heartbeatListeners) {
if (heartbeatListeners.isEmpty()) {
return;
}
// copy collection to avoid executing callbacks under lock
listeners = new ArrayList<>(heartbeatListeners);
}
for ... | java | private void notifyHeartbeat() {
ArrayList<NGHeartbeatListener> listeners;
synchronized (heartbeatListeners) {
if (heartbeatListeners.isEmpty()) {
return;
}
// copy collection to avoid executing callbacks under lock
listeners = new ArrayList<>(heartbeatListeners);
}
for ... | [
"private",
"void",
"notifyHeartbeat",
"(",
")",
"{",
"ArrayList",
"<",
"NGHeartbeatListener",
">",
"listeners",
";",
"synchronized",
"(",
"heartbeatListeners",
")",
"{",
"if",
"(",
"heartbeatListeners",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
... | Calls heartbeatReceived method on all registered NGHeartbeatListeners. | [
"Calls",
"heartbeatReceived",
"method",
"on",
"all",
"registered",
"NGHeartbeatListeners",
"."
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java#L656-L669 |
116,605 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java | NGSession.run | public void run(Socket socket) {
synchronized (lock) {
nextSocket = socket;
lock.notify();
}
Thread.yield();
} | java | public void run(Socket socket) {
synchronized (lock) {
nextSocket = socket;
lock.notify();
}
Thread.yield();
} | [
"public",
"void",
"run",
"(",
"Socket",
"socket",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"nextSocket",
"=",
"socket",
";",
"lock",
".",
"notify",
"(",
")",
";",
"}",
"Thread",
".",
"yield",
"(",
")",
";",
"}"
] | Instructs this NGSession to process the specified socket, after which this NGSession will
return itself to the pool from which it came.
@param socket the socket (connected to a client) to process | [
"Instructs",
"this",
"NGSession",
"to",
"process",
"the",
"specified",
"socket",
"after",
"which",
"this",
"NGSession",
"will",
"return",
"itself",
"to",
"the",
"pool",
"from",
"which",
"it",
"came",
"."
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java#L138-L144 |
116,606 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java | NGSession.nextSocket | private Socket nextSocket() {
Socket result;
synchronized (lock) {
result = nextSocket;
while (!done && result == null) {
try {
lock.wait();
} catch (InterruptedException e) {
done = true;
}
result = nextSocket;
}
nextSocket = null;
... | java | private Socket nextSocket() {
Socket result;
synchronized (lock) {
result = nextSocket;
while (!done && result == null) {
try {
lock.wait();
} catch (InterruptedException e) {
done = true;
}
result = nextSocket;
}
nextSocket = null;
... | [
"private",
"Socket",
"nextSocket",
"(",
")",
"{",
"Socket",
"result",
";",
"synchronized",
"(",
"lock",
")",
"{",
"result",
"=",
"nextSocket",
";",
"while",
"(",
"!",
"done",
"&&",
"result",
"==",
"null",
")",
"{",
"try",
"{",
"lock",
".",
"wait",
"(... | Returns the next socket to process. This will block the NGSession thread until there's a socket
to process or the NGSession has been shut down.
@return the next socket to process, or <code>null</code> if the NGSession has been shut down. | [
"Returns",
"the",
"next",
"socket",
"to",
"process",
".",
"This",
"will",
"block",
"the",
"NGSession",
"thread",
"until",
"there",
"s",
"a",
"socket",
"to",
"process",
"or",
"the",
"NGSession",
"has",
"been",
"shut",
"down",
"."
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java#L152-L184 |
116,607 | facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java | NGSession.run | public void run() {
updateThreadName(null);
LOG.log(Level.FINE, "NGSession {0} is waiting for first client to connect", instanceNumber);
Socket socket = nextSocket();
while (socket != null) {
LOG.log(Level.FINE, "NGSession {0} accepted new connection", instanceNumber);
try (NGCommunicator ... | java | public void run() {
updateThreadName(null);
LOG.log(Level.FINE, "NGSession {0} is waiting for first client to connect", instanceNumber);
Socket socket = nextSocket();
while (socket != null) {
LOG.log(Level.FINE, "NGSession {0} accepted new connection", instanceNumber);
try (NGCommunicator ... | [
"public",
"void",
"run",
"(",
")",
"{",
"updateThreadName",
"(",
"null",
")",
";",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"NGSession {0} is waiting for first client to connect\"",
",",
"instanceNumber",
")",
";",
"Socket",
"socket",
"=",
"nextSocke... | The main NGSession loop. This gets the next socket to process, runs the nail for the socket,
and loops until shut down. | [
"The",
"main",
"NGSession",
"loop",
".",
"This",
"gets",
"the",
"next",
"socket",
"to",
"process",
"runs",
"the",
"nail",
"for",
"the",
"socket",
"and",
"loops",
"until",
"shut",
"down",
"."
] | 948c51c5fce138c65bb3df369c3f7b4d01440605 | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGSession.java#L190-L225 |
116,608 | tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java | BlurDialogEngine.onResume | public void onResume(boolean retainedInstance) {
if (mBlurredBackgroundView == null || retainedInstance) {
if (mHoldingActivity.getWindow().getDecorView().isShown()) {
mBluringTask = new BlurAsyncTask();
mBluringTask.execute();
} else {
mHo... | java | public void onResume(boolean retainedInstance) {
if (mBlurredBackgroundView == null || retainedInstance) {
if (mHoldingActivity.getWindow().getDecorView().isShown()) {
mBluringTask = new BlurAsyncTask();
mBluringTask.execute();
} else {
mHo... | [
"public",
"void",
"onResume",
"(",
"boolean",
"retainedInstance",
")",
"{",
"if",
"(",
"mBlurredBackgroundView",
"==",
"null",
"||",
"retainedInstance",
")",
"{",
"if",
"(",
"mHoldingActivity",
".",
"getWindow",
"(",
")",
".",
"getDecorView",
"(",
")",
".",
... | Resume the engine.
@param retainedInstance use getRetainInstance. | [
"Resume",
"the",
"engine",
"."
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java#L162-L185 |
116,609 | tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java | BlurDialogEngine.getActionBarHeight | private int getActionBarHeight() {
int actionBarHeight = 0;
try {
if (mToolbar != null) {
actionBarHeight = mToolbar.getHeight();
} else if (mHoldingActivity instanceof ActionBarActivity) {
ActionBar supportActionBar
= ((Action... | java | private int getActionBarHeight() {
int actionBarHeight = 0;
try {
if (mToolbar != null) {
actionBarHeight = mToolbar.getHeight();
} else if (mHoldingActivity instanceof ActionBarActivity) {
ActionBar supportActionBar
= ((Action... | [
"private",
"int",
"getActionBarHeight",
"(",
")",
"{",
"int",
"actionBarHeight",
"=",
"0",
";",
"try",
"{",
"if",
"(",
"mToolbar",
"!=",
"null",
")",
"{",
"actionBarHeight",
"=",
"mToolbar",
".",
"getHeight",
"(",
")",
";",
"}",
"else",
"if",
"(",
"mHo... | Retrieve action bar height.
@return action bar height in px. | [
"Retrieve",
"action",
"bar",
"height",
"."
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java#L452-L485 |
116,610 | tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java | BlurDialogEngine.getStatusBarHeight | private int getStatusBarHeight() {
int result = 0;
int resourceId = mHoldingActivity.getResources()
.getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = mHoldingActivity.getResources().getDimensionPixelSize(resourceId);
}
... | java | private int getStatusBarHeight() {
int result = 0;
int resourceId = mHoldingActivity.getResources()
.getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = mHoldingActivity.getResources().getDimensionPixelSize(resourceId);
}
... | [
"private",
"int",
"getStatusBarHeight",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"resourceId",
"=",
"mHoldingActivity",
".",
"getResources",
"(",
")",
".",
"getIdentifier",
"(",
"\"status_bar_height\"",
",",
"\"dimen\"",
",",
"\"android\"",
")",
"... | retrieve status bar height in px
@return status bar height in px | [
"retrieve",
"status",
"bar",
"height",
"in",
"px"
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java#L492-L500 |
116,611 | tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java | BlurDialogEngine.getNavigationBarOffset | private int getNavigationBarOffset() {
int result = 0;
Resources resources = mHoldingActivity.getResources();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId... | java | private int getNavigationBarOffset() {
int result = 0;
Resources resources = mHoldingActivity.getResources();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId... | [
"private",
"int",
"getNavigationBarOffset",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"Resources",
"resources",
"=",
"mHoldingActivity",
".",
"getResources",
"(",
")",
";",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSI... | Retrieve offset introduce by the navigation bar.
@return bottom offset due to navigation bar. | [
"Retrieve",
"offset",
"introduce",
"by",
"the",
"navigation",
"bar",
"."
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java#L507-L517 |
116,612 | tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java | BlurDialogEngine.isStatusBarTranslucent | @TargetApi(Build.VERSION_CODES.KITKAT)
private boolean isStatusBarTranslucent() {
TypedValue typedValue = new TypedValue();
int[] attribute = new int[]{android.R.attr.windowTranslucentStatus};
TypedArray array = mHoldingActivity.obtainStyledAttributes(typedValue.resourceId, attribute);
... | java | @TargetApi(Build.VERSION_CODES.KITKAT)
private boolean isStatusBarTranslucent() {
TypedValue typedValue = new TypedValue();
int[] attribute = new int[]{android.R.attr.windowTranslucentStatus};
TypedArray array = mHoldingActivity.obtainStyledAttributes(typedValue.resourceId, attribute);
... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"KITKAT",
")",
"private",
"boolean",
"isStatusBarTranslucent",
"(",
")",
"{",
"TypedValue",
"typedValue",
"=",
"new",
"TypedValue",
"(",
")",
";",
"int",
"[",
"]",
"attribute",
"=",
"new",
"int",
"... | Used to check if the status bar is translucent.
@return true if the status bar is translucent. | [
"Used",
"to",
"check",
"if",
"the",
"status",
"bar",
"is",
"translucent",
"."
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java#L524-L532 |
116,613 | tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java | BlurDialogEngine.removeBlurredView | private void removeBlurredView() {
if (mBlurredBackgroundView != null) {
ViewGroup parent = (ViewGroup) mBlurredBackgroundView.getParent();
if (parent != null) {
parent.removeView(mBlurredBackgroundView);
}
mBlurredBackgroundView = null;
}
... | java | private void removeBlurredView() {
if (mBlurredBackgroundView != null) {
ViewGroup parent = (ViewGroup) mBlurredBackgroundView.getParent();
if (parent != null) {
parent.removeView(mBlurredBackgroundView);
}
mBlurredBackgroundView = null;
}
... | [
"private",
"void",
"removeBlurredView",
"(",
")",
"{",
"if",
"(",
"mBlurredBackgroundView",
"!=",
"null",
")",
"{",
"ViewGroup",
"parent",
"=",
"(",
"ViewGroup",
")",
"mBlurredBackgroundView",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
"!=",
"null... | Removed the blurred view from the view hierarchy. | [
"Removed",
"the",
"blurred",
"view",
"from",
"the",
"view",
"hierarchy",
"."
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/BlurDialogEngine.java#L537-L545 |
116,614 | tvbarthel/BlurDialogFragment | lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/RenderScriptBlurHelper.java | RenderScriptBlurHelper.doBlur | public static Bitmap doBlur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap, Context context) {
Bitmap bitmap;
if (canReuseInBitmap) {
bitmap = sentBitmap;
} else {
bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
}
if (bitmap.getConfig() ... | java | public static Bitmap doBlur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap, Context context) {
Bitmap bitmap;
if (canReuseInBitmap) {
bitmap = sentBitmap;
} else {
bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
}
if (bitmap.getConfig() ... | [
"public",
"static",
"Bitmap",
"doBlur",
"(",
"Bitmap",
"sentBitmap",
",",
"int",
"radius",
",",
"boolean",
"canReuseInBitmap",
",",
"Context",
"context",
")",
"{",
"Bitmap",
"bitmap",
";",
"if",
"(",
"canReuseInBitmap",
")",
"{",
"bitmap",
"=",
"sentBitmap",
... | blur a given bitmap
@param sentBitmap bitmap to blur
@param radius blur radius
@param canReuseInBitmap true if bitmap must be reused without blur
@param context used by RenderScript, can be null if RenderScript disabled
@return blurred bitmap | [
"blur",
"a",
"given",
"bitmap"
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/lib/src/main/java/fr/tvbarthel/lib/blurdialogfragment/RenderScriptBlurHelper.java#L38-L71 |
116,615 | tvbarthel/BlurDialogFragment | sample/src/main/java/fr/tvbarthel/lib/blurdialogfragment/sample/SampleActivity.java | SampleActivity.setUpView | private void setUpView() {
mBlurRadiusSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
mBlurRadiusTextView.setText(mBlurPrefix + progress);
}
... | java | private void setUpView() {
mBlurRadiusSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
mBlurRadiusTextView.setText(mBlurPrefix + progress);
}
... | [
"private",
"void",
"setUpView",
"(",
")",
"{",
"mBlurRadiusSeekbar",
".",
"setOnSeekBarChangeListener",
"(",
"new",
"SeekBar",
".",
"OnSeekBarChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onProgressChanged",
"(",
"SeekBar",
"seekBar",
",",
"i... | Set up widgets. | [
"Set",
"up",
"widgets",
"."
] | 0afc03c98ea144e1f5b0eb6e510ba6440499111d | https://github.com/tvbarthel/BlurDialogFragment/blob/0afc03c98ea144e1f5b0eb6e510ba6440499111d/sample/src/main/java/fr/tvbarthel/lib/blurdialogfragment/sample/SampleActivity.java#L115-L157 |
116,616 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/event/EventDispatcherBase.java | EventDispatcherBase.checkRunningListenersAndStartIfPossible | private void checkRunningListenersAndStartIfPossible(DispatchQueueSelector queueSelector) {
synchronized (queuedListenerTasks) {
// if either
// - running for object-independent tasks or
// - running for object-dependent tasks, but queue is empty or not present
Qu... | java | private void checkRunningListenersAndStartIfPossible(DispatchQueueSelector queueSelector) {
synchronized (queuedListenerTasks) {
// if either
// - running for object-independent tasks or
// - running for object-dependent tasks, but queue is empty or not present
Qu... | [
"private",
"void",
"checkRunningListenersAndStartIfPossible",
"(",
"DispatchQueueSelector",
"queueSelector",
")",
"{",
"synchronized",
"(",
"queuedListenerTasks",
")",
"{",
"// if either",
"// - running for object-independent tasks or",
"// - running for object-dependent tasks, but que... | Checks if there are listeners running for the given object and if
not it takes one from the queue for the object and executes it.
<p>If all object-dependent tasks are finished,
object-independent ones will be executed instead
and after all object-independent are finished,
new object-dependent tasks can get queued.
@p... | [
"Checks",
"if",
"there",
"are",
"listeners",
"running",
"for",
"the",
"given",
"object",
"and",
"if",
"not",
"it",
"takes",
"one",
"from",
"the",
"queue",
"for",
"the",
"object",
"and",
"executes",
"it",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/event/EventDispatcherBase.java#L213-L279 |
116,617 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/event/EventDispatcherBase.java | EventDispatcherBase.getThreadType | private String getThreadType(DispatchQueueSelector queueSelector) {
String threadType;
if (queueSelector instanceof DiscordApi) {
threadType = "a global listener thread";
} else if (queueSelector == null) {
threadType = "a connection listener thread";
} else {
... | java | private String getThreadType(DispatchQueueSelector queueSelector) {
String threadType;
if (queueSelector instanceof DiscordApi) {
threadType = "a global listener thread";
} else if (queueSelector == null) {
threadType = "a connection listener thread";
} else {
... | [
"private",
"String",
"getThreadType",
"(",
"DispatchQueueSelector",
"queueSelector",
")",
"{",
"String",
"threadType",
";",
"if",
"(",
"queueSelector",
"instanceof",
"DiscordApi",
")",
"{",
"threadType",
"=",
"\"a global listener thread\"",
";",
"}",
"else",
"if",
"... | Gets the thread type used in log message for the given queue selector.
@param queueSelector The queue selector.
@return The name of the thread type. | [
"Gets",
"the",
"thread",
"type",
"used",
"in",
"log",
"message",
"for",
"the",
"given",
"queue",
"selector",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/event/EventDispatcherBase.java#L287-L297 |
116,618 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java | ServerUpdater.setNickname | public ServerUpdater setNickname(User user, String nickname) {
delegate.setNickname(user, nickname);
return this;
} | java | public ServerUpdater setNickname(User user, String nickname) {
delegate.setNickname(user, nickname);
return this;
} | [
"public",
"ServerUpdater",
"setNickname",
"(",
"User",
"user",
",",
"String",
"nickname",
")",
"{",
"delegate",
".",
"setNickname",
"(",
"user",
",",
"nickname",
")",
";",
"return",
"this",
";",
"}"
] | Queues a user's nickname to be updated.
@param user The user whose nickname should be updated.
@param nickname The new nickname of the user.
@return The current instance in order to chain call methods. | [
"Queues",
"a",
"user",
"s",
"nickname",
"to",
"be",
"updated",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L408-L411 |
116,619 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java | ServerUpdater.setVoiceChannel | public ServerUpdater setVoiceChannel(User user, ServerVoiceChannel channel) {
delegate.setVoiceChannel(user, channel);
return this;
} | java | public ServerUpdater setVoiceChannel(User user, ServerVoiceChannel channel) {
delegate.setVoiceChannel(user, channel);
return this;
} | [
"public",
"ServerUpdater",
"setVoiceChannel",
"(",
"User",
"user",
",",
"ServerVoiceChannel",
"channel",
")",
"{",
"delegate",
".",
"setVoiceChannel",
"(",
"user",
",",
"channel",
")",
";",
"return",
"this",
";",
"}"
] | Queues a moving a user to a different voice channel.
@param user The user who should be moved.
@param channel The new voice channel of the user.
@return The current instance in order to chain call methods. | [
"Queues",
"a",
"moving",
"a",
"user",
"to",
"a",
"different",
"voice",
"channel",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L444-L447 |
116,620 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java | ServerUpdater.addRoleToUser | public ServerUpdater addRoleToUser(User user, Role role) {
delegate.addRoleToUser(user, role);
return this;
} | java | public ServerUpdater addRoleToUser(User user, Role role) {
delegate.addRoleToUser(user, role);
return this;
} | [
"public",
"ServerUpdater",
"addRoleToUser",
"(",
"User",
"user",
",",
"Role",
"role",
")",
"{",
"delegate",
".",
"addRoleToUser",
"(",
"user",
",",
"role",
")",
";",
"return",
"this",
";",
"}"
] | Queues a role to be assigned to the user.
@param user The server member the role should be added to.
@param role The role which should be added to the server member.
@return The current instance in order to chain call methods. | [
"Queues",
"a",
"role",
"to",
"be",
"assigned",
"to",
"the",
"user",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L467-L470 |
116,621 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java | ServerUpdater.addRolesToUser | public ServerUpdater addRolesToUser(User user, Collection<Role> roles) {
delegate.addRolesToUser(user, roles);
return this;
} | java | public ServerUpdater addRolesToUser(User user, Collection<Role> roles) {
delegate.addRolesToUser(user, roles);
return this;
} | [
"public",
"ServerUpdater",
"addRolesToUser",
"(",
"User",
"user",
",",
"Collection",
"<",
"Role",
">",
"roles",
")",
"{",
"delegate",
".",
"addRolesToUser",
"(",
"user",
",",
"roles",
")",
";",
"return",
"this",
";",
"}"
] | Queues a collection of roles to be assigned to the user.
@param user The server member the role should be added to.
@param roles The roles which should be added to the server member.
@return The current instance in order to chain call methods. | [
"Queues",
"a",
"collection",
"of",
"roles",
"to",
"be",
"assigned",
"to",
"the",
"user",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L479-L482 |
116,622 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java | ServerUpdater.removeRoleFromUser | public ServerUpdater removeRoleFromUser(User user, Role role) {
delegate.removeRoleFromUser(user, role);
return this;
} | java | public ServerUpdater removeRoleFromUser(User user, Role role) {
delegate.removeRoleFromUser(user, role);
return this;
} | [
"public",
"ServerUpdater",
"removeRoleFromUser",
"(",
"User",
"user",
",",
"Role",
"role",
")",
"{",
"delegate",
".",
"removeRoleFromUser",
"(",
"user",
",",
"role",
")",
";",
"return",
"this",
";",
"}"
] | Queues a role to be removed from the user.
@param user The server member the role should be removed from.
@param role The role which should be removed from the user.
@return The current instance in order to chain call methods. | [
"Queues",
"a",
"role",
"to",
"be",
"removed",
"from",
"the",
"user",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L491-L494 |
116,623 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java | ServerUpdater.removeRolesFromUser | public ServerUpdater removeRolesFromUser(User user, Collection<Role> roles) {
delegate.removeRolesFromUser(user, roles);
return this;
} | java | public ServerUpdater removeRolesFromUser(User user, Collection<Role> roles) {
delegate.removeRolesFromUser(user, roles);
return this;
} | [
"public",
"ServerUpdater",
"removeRolesFromUser",
"(",
"User",
"user",
",",
"Collection",
"<",
"Role",
">",
"roles",
")",
"{",
"delegate",
".",
"removeRolesFromUser",
"(",
"user",
",",
"roles",
")",
";",
"return",
"this",
";",
"}"
] | Queues a collection of roles to be removed from the user.
@param user The server member the roles should be removed from.
@param roles The roles which should be removed from the user.
@return The current instance in order to chain call methods. | [
"Queues",
"a",
"collection",
"of",
"roles",
"to",
"be",
"removed",
"from",
"the",
"user",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L503-L506 |
116,624 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/channel/ServerChannelUpdaterDelegateImpl.java | ServerChannelUpdaterDelegateImpl.populatePermissionOverwrites | private void populatePermissionOverwrites() {
if (overwrittenUserPermissions == null) {
overwrittenUserPermissions = new HashMap<>();
overwrittenUserPermissions.putAll(((ServerChannelImpl) channel).getInternalOverwrittenUserPermissions());
}
if (overwrittenRolePermissions... | java | private void populatePermissionOverwrites() {
if (overwrittenUserPermissions == null) {
overwrittenUserPermissions = new HashMap<>();
overwrittenUserPermissions.putAll(((ServerChannelImpl) channel).getInternalOverwrittenUserPermissions());
}
if (overwrittenRolePermissions... | [
"private",
"void",
"populatePermissionOverwrites",
"(",
")",
"{",
"if",
"(",
"overwrittenUserPermissions",
"==",
"null",
")",
"{",
"overwrittenUserPermissions",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"overwrittenUserPermissions",
".",
"putAll",
"(",
"(",
"(",... | Populates the maps which contain the permission overwrites. | [
"Populates",
"the",
"maps",
"which",
"contain",
"the",
"permission",
"overwrites",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/channel/ServerChannelUpdaterDelegateImpl.java#L154-L163 |
116,625 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java | UserImpl.setChannel | public void setChannel(PrivateChannel channel) {
if (this.channel != channel) {
if (this.channel != null) {
((Cleanupable) this.channel).cleanup();
}
this.channel = channel;
}
} | java | public void setChannel(PrivateChannel channel) {
if (this.channel != channel) {
if (this.channel != null) {
((Cleanupable) this.channel).cleanup();
}
this.channel = channel;
}
} | [
"public",
"void",
"setChannel",
"(",
"PrivateChannel",
"channel",
")",
"{",
"if",
"(",
"this",
".",
"channel",
"!=",
"channel",
")",
"{",
"if",
"(",
"this",
".",
"channel",
"!=",
"null",
")",
"{",
"(",
"(",
"Cleanupable",
")",
"this",
".",
"channel",
... | Sets the private channel with the user.
@param channel The channel to set. | [
"Sets",
"the",
"private",
"channel",
"with",
"the",
"user",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java#L117-L124 |
116,626 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java | UserImpl.getOrCreateChannel | public PrivateChannel getOrCreateChannel(JsonNode data) {
synchronized (this) {
if (channel != null) {
return channel;
}
return new PrivateChannelImpl(api, data);
}
} | java | public PrivateChannel getOrCreateChannel(JsonNode data) {
synchronized (this) {
if (channel != null) {
return channel;
}
return new PrivateChannelImpl(api, data);
}
} | [
"public",
"PrivateChannel",
"getOrCreateChannel",
"(",
"JsonNode",
"data",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"channel",
"!=",
"null",
")",
"{",
"return",
"channel",
";",
"}",
"return",
"new",
"PrivateChannelImpl",
"(",
"api",
",",
... | Gets or creates a new private channel.
@param data The data of the private channel.
@return The private channel for the given data. | [
"Gets",
"or",
"creates",
"a",
"new",
"private",
"channel",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java#L197-L204 |
116,627 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java | UserImpl.getAvatar | public static Icon getAvatar(DiscordApi api, String avatarHash, String discriminator, long userId) {
StringBuilder url = new StringBuilder("https://cdn.discordapp.com/");
if (avatarHash == null) {
url.append("embed/avatars/")
.append(Integer.parseInt(discriminator) % 5)
... | java | public static Icon getAvatar(DiscordApi api, String avatarHash, String discriminator, long userId) {
StringBuilder url = new StringBuilder("https://cdn.discordapp.com/");
if (avatarHash == null) {
url.append("embed/avatars/")
.append(Integer.parseInt(discriminator) % 5)
... | [
"public",
"static",
"Icon",
"getAvatar",
"(",
"DiscordApi",
"api",
",",
"String",
"avatarHash",
",",
"String",
"discriminator",
",",
"long",
"userId",
")",
"{",
"StringBuilder",
"url",
"=",
"new",
"StringBuilder",
"(",
"\"https://cdn.discordapp.com/\"",
")",
";",
... | Gets the avatar for the given details.
@param api The discord api instance.
@param avatarHash The avatar hash or {@code null} for default avatar.
@param discriminator The discriminator if default avatar is wanted.
@param userId The user id.
@return The avatar for the given details. | [
"Gets",
"the",
"avatar",
"for",
"the",
"given",
"details",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java#L245-L262 |
116,628 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessages | private static CompletableFuture<MessageSet> getMessages(TextChannel channel, int limit, long before, long after) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
// get the initial ... | java | private static CompletableFuture<MessageSet> getMessages(TextChannel channel, int limit, long before, long after) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
// get the initial ... | [
"private",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessages",
"(",
"TextChannel",
"channel",
",",
"int",
"limit",
",",
"long",
"before",
",",
"long",
"after",
")",
"{",
"CompletableFuture",
"<",
"MessageSet",
">",
"future",
"=",
"new",
"Comp... | Gets up to a given amount of messages in the given channel.
@param channel The channel of the messages.
@param limit The limit of messages to get.
@param before Get messages before the message with this id.
@param after Get messages after the message with this id.
@return The messages.
@see #getMessagesAsStream(TextC... | [
"Gets",
"up",
"to",
"a",
"given",
"amount",
"of",
"messages",
"in",
"the",
"given",
"channel",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L92-L148 |
116,629 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesAsStream | private static Stream<Message> getMessagesAsStream(TextChannel channel, long before, long after) {
return StreamSupport.stream(Spliterators.spliteratorUnknownSize(new Iterator<Message>() {
private final DiscordApiImpl api = ((DiscordApiImpl) channel.getApi());
// before was set or both w... | java | private static Stream<Message> getMessagesAsStream(TextChannel channel, long before, long after) {
return StreamSupport.stream(Spliterators.spliteratorUnknownSize(new Iterator<Message>() {
private final DiscordApiImpl api = ((DiscordApiImpl) channel.getApi());
// before was set or both w... | [
"private",
"static",
"Stream",
"<",
"Message",
">",
"getMessagesAsStream",
"(",
"TextChannel",
"channel",
",",
"long",
"before",
",",
"long",
"after",
")",
"{",
"return",
"StreamSupport",
".",
"stream",
"(",
"Spliterators",
".",
"spliteratorUnknownSize",
"(",
"n... | Gets a stream of messages in the given channel sorted from newest to oldest.
<p>The messages are retrieved in batches synchronously from Discord,
so consider not using this method from a listener directly.
@param channel The channel of the messages.
@param before Get messages before the message with this id.
@param a... | [
"Gets",
"a",
"stream",
"of",
"messages",
"in",
"the",
"given",
"channel",
"sorted",
"from",
"newest",
"to",
"oldest",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L265-L305 |
116,630 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesBefore | public static CompletableFuture<MessageSet> getMessagesBefore(TextChannel channel, int limit, long before) {
return getMessages(channel, limit, before, -1);
} | java | public static CompletableFuture<MessageSet> getMessagesBefore(TextChannel channel, int limit, long before) {
return getMessages(channel, limit, before, -1);
} | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesBefore",
"(",
"TextChannel",
"channel",
",",
"int",
"limit",
",",
"long",
"before",
")",
"{",
"return",
"getMessages",
"(",
"channel",
",",
"limit",
",",
"before",
",",
"-",
"1",
")... | Gets up to a given amount of messages in the given channel before a given message in any channel.
@param channel The channel of the messages.
@param limit The limit of messages to get.
@param before Get messages before the message with this id.
@return The messages.
@see #getMessagesBeforeAsStream(TextChannel, long) | [
"Gets",
"up",
"to",
"a",
"given",
"amount",
"of",
"messages",
"in",
"the",
"given",
"channel",
"before",
"a",
"given",
"message",
"in",
"any",
"channel",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L316-L318 |
116,631 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesBeforeUntil | public static CompletableFuture<MessageSet> getMessagesBeforeUntil(
TextChannel channel, Predicate<Message> condition, long before) {
return getMessagesUntil(channel, condition, before, -1);
} | java | public static CompletableFuture<MessageSet> getMessagesBeforeUntil(
TextChannel channel, Predicate<Message> condition, long before) {
return getMessagesUntil(channel, condition, before, -1);
} | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesBeforeUntil",
"(",
"TextChannel",
"channel",
",",
"Predicate",
"<",
"Message",
">",
"condition",
",",
"long",
"before",
")",
"{",
"return",
"getMessagesUntil",
"(",
"channel",
",",
"condi... | Gets messages in the given channel before a given message in any channel until one that meets the given
condition is found.
If no message matches the condition, an empty set is returned.
@param channel The channel of the messages.
@param condition The abort condition for when to stop retrieving messages.
@param before... | [
"Gets",
"messages",
"in",
"the",
"given",
"channel",
"before",
"a",
"given",
"message",
"in",
"any",
"channel",
"until",
"one",
"that",
"meets",
"the",
"given",
"condition",
"is",
"found",
".",
"If",
"no",
"message",
"matches",
"the",
"condition",
"an",
"e... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L331-L334 |
116,632 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesBeforeWhile | public static CompletableFuture<MessageSet> getMessagesBeforeWhile(
TextChannel channel, Predicate<Message> condition, long before) {
return getMessagesWhile(channel, condition, before, -1);
} | java | public static CompletableFuture<MessageSet> getMessagesBeforeWhile(
TextChannel channel, Predicate<Message> condition, long before) {
return getMessagesWhile(channel, condition, before, -1);
} | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesBeforeWhile",
"(",
"TextChannel",
"channel",
",",
"Predicate",
"<",
"Message",
">",
"condition",
",",
"long",
"before",
")",
"{",
"return",
"getMessagesWhile",
"(",
"channel",
",",
"condi... | Gets messages in the given channel before a given message in any channel while they meet the given condition.
If the first message does not match the condition, an empty set is returned.
@param channel The channel of the messages.
@param condition The condition that has to be met.
@param before Get messages before the... | [
"Gets",
"messages",
"in",
"the",
"given",
"channel",
"before",
"a",
"given",
"message",
"in",
"any",
"channel",
"while",
"they",
"meet",
"the",
"given",
"condition",
".",
"If",
"the",
"first",
"message",
"does",
"not",
"match",
"the",
"condition",
"an",
"e... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L346-L349 |
116,633 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesAfter | public static CompletableFuture<MessageSet> getMessagesAfter(TextChannel channel, int limit, long after) {
return getMessages(channel, limit, -1, after);
} | java | public static CompletableFuture<MessageSet> getMessagesAfter(TextChannel channel, int limit, long after) {
return getMessages(channel, limit, -1, after);
} | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesAfter",
"(",
"TextChannel",
"channel",
",",
"int",
"limit",
",",
"long",
"after",
")",
"{",
"return",
"getMessages",
"(",
"channel",
",",
"limit",
",",
"-",
"1",
",",
"after",
")",
... | Gets up to a given amount of messages in the given channel after a given message in any channel.
@param channel The channel of the messages.
@param limit The limit of messages to get.
@param after Get messages after the message with this id.
@return The messages.
@see #getMessagesAfterAsStream(TextChannel, long) | [
"Gets",
"up",
"to",
"a",
"given",
"amount",
"of",
"messages",
"in",
"the",
"given",
"channel",
"after",
"a",
"given",
"message",
"in",
"any",
"channel",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L376-L378 |
116,634 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesAround | public static CompletableFuture<MessageSet> getMessagesAround(TextChannel channel, int limit, long around) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
// calculate the half limi... | java | public static CompletableFuture<MessageSet> getMessagesAround(TextChannel channel, int limit, long around) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
// calculate the half limi... | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesAround",
"(",
"TextChannel",
"channel",
",",
"int",
"limit",
",",
"long",
"around",
")",
"{",
"CompletableFuture",
"<",
"MessageSet",
">",
"future",
"=",
"new",
"CompletableFuture",
"<>",... | Gets up to a given amount of messages in the given channel around a given message in any channel.
The given message will be part of the result in addition to the messages around if it was sent in the given
channel and does not count towards the limit.
Half of the messages will be older than the given message and half o... | [
"Gets",
"up",
"to",
"a",
"given",
"amount",
"of",
"messages",
"in",
"the",
"given",
"channel",
"around",
"a",
"given",
"message",
"in",
"any",
"channel",
".",
"The",
"given",
"message",
"will",
"be",
"part",
"of",
"the",
"result",
"in",
"addition",
"to",... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L440-L477 |
116,635 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesAroundUntil | public static CompletableFuture<MessageSet> getMessagesAroundUntil(
TextChannel channel, Predicate<Message> condition, long around) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
... | java | public static CompletableFuture<MessageSet> getMessagesAroundUntil(
TextChannel channel, Predicate<Message> condition, long around) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
... | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesAroundUntil",
"(",
"TextChannel",
"channel",
",",
"Predicate",
"<",
"Message",
">",
"condition",
",",
"long",
"around",
")",
"{",
"CompletableFuture",
"<",
"MessageSet",
">",
"future",
"=... | Gets messages in the given channel around a given message in any channel until one that meets the given
condition is found. If no message matches the condition, an empty set is returned.
The given message will be part of the result in addition to the messages around if it was sent in the given
channel and is matched ag... | [
"Gets",
"messages",
"in",
"the",
"given",
"channel",
"around",
"a",
"given",
"message",
"in",
"any",
"channel",
"until",
"one",
"that",
"meets",
"the",
"given",
"condition",
"is",
"found",
".",
"If",
"no",
"message",
"matches",
"the",
"condition",
"an",
"e... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L494-L511 |
116,636 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesAroundWhile | public static CompletableFuture<MessageSet> getMessagesAroundWhile(
TextChannel channel, Predicate<Message> condition, long around) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
... | java | public static CompletableFuture<MessageSet> getMessagesAroundWhile(
TextChannel channel, Predicate<Message> condition, long around) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
... | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesAroundWhile",
"(",
"TextChannel",
"channel",
",",
"Predicate",
"<",
"Message",
">",
"condition",
",",
"long",
"around",
")",
"{",
"CompletableFuture",
"<",
"MessageSet",
">",
"future",
"=... | Gets messages in the given channel around a given message in any channel while they meet the given condition.
If the first message does not match the condition, an empty set is returned.
The given message will be part of the result in addition to the messages around if it was sent in the given
channel and is matched ag... | [
"Gets",
"messages",
"in",
"the",
"given",
"channel",
"around",
"a",
"given",
"message",
"in",
"any",
"channel",
"while",
"they",
"meet",
"the",
"given",
"condition",
".",
"If",
"the",
"first",
"message",
"does",
"not",
"match",
"the",
"condition",
"an",
"e... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L528-L547 |
116,637 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesBetween | public static CompletableFuture<MessageSet> getMessagesBetween(TextChannel channel, long from, long to) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
future.complete(new MessageSe... | java | public static CompletableFuture<MessageSet> getMessagesBetween(TextChannel channel, long from, long to) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
future.complete(new MessageSe... | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesBetween",
"(",
"TextChannel",
"channel",
",",
"long",
"from",
",",
"long",
"to",
")",
"{",
"CompletableFuture",
"<",
"MessageSet",
">",
"future",
"=",
"new",
"CompletableFuture",
"<>",
... | Gets all messages in the given channel between the first given message in any channel and the second given
message in any channel, excluding the boundaries.
Gets up to a given amount of messages in the given channel before a given message in any channel.
@param channel The channel of the messages.
@param from The id o... | [
"Gets",
"all",
"messages",
"in",
"the",
"given",
"channel",
"between",
"the",
"first",
"given",
"message",
"in",
"any",
"channel",
"and",
"the",
"second",
"given",
"message",
"in",
"any",
"channel",
"excluding",
"the",
"boundaries",
".",
"Gets",
"up",
"to",
... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L651-L662 |
116,638 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesBetweenAsStream | public static Stream<Message> getMessagesBetweenAsStream(TextChannel channel, long from, long to) {
long before = Math.max(from, to);
long after = Math.min(from, to);
Stream<Message> messages = getMessagesAsStream(channel, -1, after).filter(message -> message.getId() < before);
return (f... | java | public static Stream<Message> getMessagesBetweenAsStream(TextChannel channel, long from, long to) {
long before = Math.max(from, to);
long after = Math.min(from, to);
Stream<Message> messages = getMessagesAsStream(channel, -1, after).filter(message -> message.getId() < before);
return (f... | [
"public",
"static",
"Stream",
"<",
"Message",
">",
"getMessagesBetweenAsStream",
"(",
"TextChannel",
"channel",
",",
"long",
"from",
",",
"long",
"to",
")",
"{",
"long",
"before",
"=",
"Math",
".",
"max",
"(",
"from",
",",
"to",
")",
";",
"long",
"after"... | Gets all messages in the given channel between the first given message in any channel and the second given
message in any channel, excluding the boundaries, sorted from first given message to the second given message.
<p>The messages are retrieved in batches synchronously from Discord,
so consider not using this metho... | [
"Gets",
"all",
"messages",
"in",
"the",
"given",
"channel",
"between",
"the",
"first",
"given",
"message",
"in",
"any",
"channel",
"and",
"the",
"second",
"given",
"message",
"in",
"any",
"channel",
"excluding",
"the",
"boundaries",
"sorted",
"from",
"first",
... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L741-L746 |
116,639 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.requestAsSortedJsonNodes | private static List<JsonNode> requestAsSortedJsonNodes(
TextChannel channel, int limit, long before, long after, boolean reversed) {
List<JsonNode> messageJsonNodes = requestAsJsonNodes(channel, limit, before, after);
Comparator<JsonNode> idComparator = Comparator.comparingLong(jsonNode -> j... | java | private static List<JsonNode> requestAsSortedJsonNodes(
TextChannel channel, int limit, long before, long after, boolean reversed) {
List<JsonNode> messageJsonNodes = requestAsJsonNodes(channel, limit, before, after);
Comparator<JsonNode> idComparator = Comparator.comparingLong(jsonNode -> j... | [
"private",
"static",
"List",
"<",
"JsonNode",
">",
"requestAsSortedJsonNodes",
"(",
"TextChannel",
"channel",
",",
"int",
"limit",
",",
"long",
"before",
",",
"long",
"after",
",",
"boolean",
"reversed",
")",
"{",
"List",
"<",
"JsonNode",
">",
"messageJsonNode... | Requests the messages from Discord, sorted by their id.
@param channel The channel of which to get messages from.
@param limit The limit of messages to get.
@param before Get messages before the message with this id.
@param after Get messages after the message with this id.
@param reversed If {@code true}, get from ol... | [
"Requests",
"the",
"messages",
"from",
"Discord",
"sorted",
"by",
"their",
"id",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L775-L781 |
116,640 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/http/TrustAllTrustManager.java | TrustAllTrustManager.createSslSocketFactory | public SSLSocketFactory createSslSocketFactory() {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[]{this}, null);
return sslContext.getSocketFactory();
} catch (NoSuchAlgorithmException | KeyManagementException e) {... | java | public SSLSocketFactory createSslSocketFactory() {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[]{this}, null);
return sslContext.getSocketFactory();
} catch (NoSuchAlgorithmException | KeyManagementException e) {... | [
"public",
"SSLSocketFactory",
"createSslSocketFactory",
"(",
")",
"{",
"try",
"{",
"SSLContext",
"sslContext",
"=",
"SSLContext",
".",
"getInstance",
"(",
"\"TLS\"",
")",
";",
"sslContext",
".",
"init",
"(",
"null",
",",
"new",
"TrustManager",
"[",
"]",
"{",
... | Creates a new SSL socket factory that generates SSL sockets that trust all certificates unconditionally.
@return A new SSL socket factory that generates SSL sockets that trust all certificates unconditionally. | [
"Creates",
"a",
"new",
"SSL",
"socket",
"factory",
"that",
"generates",
"SSL",
"sockets",
"that",
"trust",
"all",
"certificates",
"unconditionally",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/http/TrustAllTrustManager.java#L33-L41 |
116,641 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiBuilderDelegateImpl.java | DiscordApiBuilderDelegateImpl.prepareListeners | @SuppressWarnings("unchecked")
private void prepareListeners() {
if (preparedListeners != null && preparedUnspecifiedListeners != null) {
// Already created, skip
return;
}
preparedListeners = new ConcurrentHashMap<>();
Stream<Class<? extends GloballyAttachabl... | java | @SuppressWarnings("unchecked")
private void prepareListeners() {
if (preparedListeners != null && preparedUnspecifiedListeners != null) {
// Already created, skip
return;
}
preparedListeners = new ConcurrentHashMap<>();
Stream<Class<? extends GloballyAttachabl... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"prepareListeners",
"(",
")",
"{",
"if",
"(",
"preparedListeners",
"!=",
"null",
"&&",
"preparedUnspecifiedListeners",
"!=",
"null",
")",
"{",
"// Already created, skip",
"return",
";",
"}",
"p... | Compile pre-registered listeners into proper collections for DiscordApi creation. | [
"Compile",
"pre",
"-",
"registered",
"listeners",
"into",
"proper",
"collections",
"for",
"DiscordApi",
"creation",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiBuilderDelegateImpl.java#L173-L202 |
116,642 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/event/server/ServerChangeSplashEventImpl.java | ServerChangeSplashEventImpl.getSplash | private Optional<Icon> getSplash(String splashHash) {
if (splashHash == null) {
return Optional.empty();
}
try {
return Optional.of(new IconImpl(getApi(),
new URL("https://cdn.discordapp.com/splashs/" + getServer().getIdAsString... | java | private Optional<Icon> getSplash(String splashHash) {
if (splashHash == null) {
return Optional.empty();
}
try {
return Optional.of(new IconImpl(getApi(),
new URL("https://cdn.discordapp.com/splashs/" + getServer().getIdAsString... | [
"private",
"Optional",
"<",
"Icon",
">",
"getSplash",
"(",
"String",
"splashHash",
")",
"{",
"if",
"(",
"splashHash",
"==",
"null",
")",
"{",
"return",
"Optional",
".",
"empty",
"(",
")",
";",
"}",
"try",
"{",
"return",
"Optional",
".",
"of",
"(",
"n... | Gets the splash for the given hash.
@param splashHash The hash of the splash.
@return The splash with the given hash. | [
"Gets",
"the",
"splash",
"for",
"the",
"given",
"hash",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/event/server/ServerChangeSplashEventImpl.java#L63-L75 |
116,643 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/concurrent/ThreadPoolImpl.java | ThreadPoolImpl.shutdown | public void shutdown() {
executorService.shutdown();
scheduler.shutdown();
daemonScheduler.shutdown();
executorServiceSingleThreads.values().forEach(ExecutorService::shutdown);
} | java | public void shutdown() {
executorService.shutdown();
scheduler.shutdown();
daemonScheduler.shutdown();
executorServiceSingleThreads.values().forEach(ExecutorService::shutdown);
} | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"executorService",
".",
"shutdown",
"(",
")",
";",
"scheduler",
".",
"shutdown",
"(",
")",
";",
"daemonScheduler",
".",
"shutdown",
"(",
")",
";",
"executorServiceSingleThreads",
".",
"values",
"(",
")",
".",
"f... | Shutdowns the thread pool.
This method is called automatically after disconnecting. | [
"Shutdowns",
"the",
"thread",
"pool",
".",
"This",
"method",
"is",
"called",
"automatically",
"after",
"disconnecting",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/concurrent/ThreadPoolImpl.java#L37-L42 |
116,644 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java | MessageBuilder.fromMessage | public static MessageBuilder fromMessage(Message message) {
MessageBuilder builder = new MessageBuilder();
builder.getStringBuilder().append(message.getContent());
if (!message.getEmbeds().isEmpty()) {
builder.setEmbed(message.getEmbeds().get(0).toBuilder());
}
for (M... | java | public static MessageBuilder fromMessage(Message message) {
MessageBuilder builder = new MessageBuilder();
builder.getStringBuilder().append(message.getContent());
if (!message.getEmbeds().isEmpty()) {
builder.setEmbed(message.getEmbeds().get(0).toBuilder());
}
for (M... | [
"public",
"static",
"MessageBuilder",
"fromMessage",
"(",
"Message",
"message",
")",
"{",
"MessageBuilder",
"builder",
"=",
"new",
"MessageBuilder",
"(",
")",
";",
"builder",
".",
"getStringBuilder",
"(",
")",
".",
"append",
"(",
"message",
".",
"getContent",
... | Creates a message builder from a message.
@param message The message to copy.
@return A message builder which would produce the same text as the given message. | [
"Creates",
"a",
"message",
"builder",
"from",
"a",
"message",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java#L33-L44 |
116,645 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java | MessageBuilder.appendCode | public MessageBuilder appendCode(String language, String code) {
delegate.appendCode(language, code);
return this;
} | java | public MessageBuilder appendCode(String language, String code) {
delegate.appendCode(language, code);
return this;
} | [
"public",
"MessageBuilder",
"appendCode",
"(",
"String",
"language",
",",
"String",
"code",
")",
"{",
"delegate",
".",
"appendCode",
"(",
"language",
",",
"code",
")",
";",
"return",
"this",
";",
"}"
] | Appends code to the message.
@param language The language, e.g. "java".
@param code The code.
@return The current instance in order to chain call methods. | [
"Appends",
"code",
"to",
"the",
"message",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java#L53-L56 |
116,646 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java | MessageBuilder.append | public MessageBuilder append(String message, MessageDecoration... decorations) {
delegate.append(message, decorations);
return this;
} | java | public MessageBuilder append(String message, MessageDecoration... decorations) {
delegate.append(message, decorations);
return this;
} | [
"public",
"MessageBuilder",
"append",
"(",
"String",
"message",
",",
"MessageDecoration",
"...",
"decorations",
")",
"{",
"delegate",
".",
"append",
"(",
"message",
",",
"decorations",
")",
";",
"return",
"this",
";",
"}"
] | Appends a sting with or without decoration to the message.
@param message The string to append.
@param decorations The decorations of the string.
@return The current instance in order to chain call methods. | [
"Appends",
"a",
"sting",
"with",
"or",
"without",
"decoration",
"to",
"the",
"message",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java#L65-L68 |
116,647 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java | MessageBuilder.addAttachment | public MessageBuilder addAttachment(BufferedImage image, String fileName) {
delegate.addAttachment(image, fileName);
return this;
} | java | public MessageBuilder addAttachment(BufferedImage image, String fileName) {
delegate.addAttachment(image, fileName);
return this;
} | [
"public",
"MessageBuilder",
"addAttachment",
"(",
"BufferedImage",
"image",
",",
"String",
"fileName",
")",
"{",
"delegate",
".",
"addAttachment",
"(",
"image",
",",
"fileName",
")",
";",
"return",
"this",
";",
"}"
] | Adds an attachment to the message.
@param image The image to add as an attachment.
@param fileName The file name of the image.
@return The current instance in order to chain call methods. | [
"Adds",
"an",
"attachment",
"to",
"the",
"message",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java#L295-L298 |
116,648 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java | MessageBuilder.addAttachmentAsSpoiler | public MessageBuilder addAttachmentAsSpoiler(InputStream stream, String fileName) {
delegate.addAttachment(stream, "SPOILER_" + fileName);
return this;
} | java | public MessageBuilder addAttachmentAsSpoiler(InputStream stream, String fileName) {
delegate.addAttachment(stream, "SPOILER_" + fileName);
return this;
} | [
"public",
"MessageBuilder",
"addAttachmentAsSpoiler",
"(",
"InputStream",
"stream",
",",
"String",
"fileName",
")",
"{",
"delegate",
".",
"addAttachment",
"(",
"stream",
",",
"\"SPOILER_\"",
"+",
"fileName",
")",
";",
"return",
"this",
";",
"}"
] | Adds an attachment to the message and marks it as spoiler.
@param stream The stream of the file.
@param fileName The name of the file.
@return The current instance in order to chain call methods. | [
"Adds",
"an",
"attachment",
"to",
"the",
"message",
"and",
"marks",
"it",
"as",
"spoiler",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/MessageBuilder.java#L421-L424 |
116,649 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java | MessageImpl.addReaction | public void addReaction(Emoji emoji, boolean you) {
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
reaction.ifPresent(r -> ((ReactionImpl) r).incrementCount(you));
if (!reaction.isPresent()) {
reactions.add(new ReactionImpl(th... | java | public void addReaction(Emoji emoji, boolean you) {
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
reaction.ifPresent(r -> ((ReactionImpl) r).incrementCount(you));
if (!reaction.isPresent()) {
reactions.add(new ReactionImpl(th... | [
"public",
"void",
"addReaction",
"(",
"Emoji",
"emoji",
",",
"boolean",
"you",
")",
"{",
"Optional",
"<",
"Reaction",
">",
"reaction",
"=",
"reactions",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"r",
"->",
"emoji",
".",
"equalsEmoji",
"(",
"r",
".",... | Adds an emoji to the list of reactions.
@param emoji The emoji.
@param you Whether this reaction is used by you or not. | [
"Adds",
"an",
"emoji",
"to",
"the",
"list",
"of",
"reactions",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java#L260-L266 |
116,650 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java | MessageImpl.removeReaction | public void removeReaction(Emoji emoji, boolean you) {
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
reaction.ifPresent(r -> ((ReactionImpl) r).decrementCount(you));
reactions.removeIf(r -> r.getCount() <= 0);
} | java | public void removeReaction(Emoji emoji, boolean you) {
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
reaction.ifPresent(r -> ((ReactionImpl) r).decrementCount(you));
reactions.removeIf(r -> r.getCount() <= 0);
} | [
"public",
"void",
"removeReaction",
"(",
"Emoji",
"emoji",
",",
"boolean",
"you",
")",
"{",
"Optional",
"<",
"Reaction",
">",
"reaction",
"=",
"reactions",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"r",
"->",
"emoji",
".",
"equalsEmoji",
"(",
"r",
"... | Removes an emoji from the list of reactions.
@param emoji The emoji.
@param you Whether this reaction is used by you or not. | [
"Removes",
"an",
"emoji",
"from",
"the",
"list",
"of",
"reactions",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java#L274-L278 |
116,651 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/ClassHelper.java | ClassHelper.getInterfaces | public static List<Class<?>> getInterfaces(Class<?> clazz) {
return getInterfacesAsStream(clazz).collect(Collectors.toList());
} | java | public static List<Class<?>> getInterfaces(Class<?> clazz) {
return getInterfacesAsStream(clazz).collect(Collectors.toList());
} | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"getInterfaces",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"return",
"getInterfacesAsStream",
"(",
"clazz",
")",
".",
"collect",
"(",
"Collectors",
".",
"toList",
"(",
")",
")",
";",
... | Get all interfaces of the given class including extended interfaces and interfaces of all superclasses.
If the given class is an interface, it will be included in the result, otherwise not.
@param clazz The class to get the interfaces for.
@return The interfaces of the given class. | [
"Get",
"all",
"interfaces",
"of",
"the",
"given",
"class",
"including",
"extended",
"interfaces",
"and",
"interfaces",
"of",
"all",
"superclasses",
".",
"If",
"the",
"given",
"class",
"is",
"an",
"interface",
"it",
"will",
"be",
"included",
"in",
"the",
"res... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/ClassHelper.java#L25-L27 |
116,652 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/ClassHelper.java | ClassHelper.getInterfacesAsStream | public static Stream<Class<?>> getInterfacesAsStream(Class<?> clazz) {
return getSuperclassesAsStream(clazz, true)
.flatMap(superClass -> Stream.concat(
superClass.isInterface() ? Stream.of(superClass) : Stream.empty(),
Arrays.stream(superClass.get... | java | public static Stream<Class<?>> getInterfacesAsStream(Class<?> clazz) {
return getSuperclassesAsStream(clazz, true)
.flatMap(superClass -> Stream.concat(
superClass.isInterface() ? Stream.of(superClass) : Stream.empty(),
Arrays.stream(superClass.get... | [
"public",
"static",
"Stream",
"<",
"Class",
"<",
"?",
">",
">",
"getInterfacesAsStream",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"return",
"getSuperclassesAsStream",
"(",
"clazz",
",",
"true",
")",
".",
"flatMap",
"(",
"superClass",
"->",
"Stream",... | Get a stream of all interfaces of the given class including extended interfaces and interfaces of all
superclasses.
If the given class is an interface, it will be included in the result, otherwise not.
@param clazz The class to get the interfaces for.
@return The stream of interfaces of the given class. | [
"Get",
"a",
"stream",
"of",
"all",
"interfaces",
"of",
"the",
"given",
"class",
"including",
"extended",
"interfaces",
"and",
"interfaces",
"of",
"all",
"superclasses",
".",
"If",
"the",
"given",
"class",
"is",
"an",
"interface",
"it",
"will",
"be",
"include... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/ClassHelper.java#L37-L43 |
116,653 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/ClassHelper.java | ClassHelper.getSuperclasses | public static List<Class<?>> getSuperclasses(Class<?> clazz) {
return getSuperclassesAsStream(clazz).collect(Collectors.toList());
} | java | public static List<Class<?>> getSuperclasses(Class<?> clazz) {
return getSuperclassesAsStream(clazz).collect(Collectors.toList());
} | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"getSuperclasses",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"return",
"getSuperclassesAsStream",
"(",
"clazz",
")",
".",
"collect",
"(",
"Collectors",
".",
"toList",
"(",
")",
")",
";... | Get all superclasses of the given class.
If the given class is an interface, the result will be empty.
The given class will not be included in the result.
@param clazz The class to get the superclasses for.
@return The superclasses of the given class. | [
"Get",
"all",
"superclasses",
"of",
"the",
"given",
"class",
".",
"If",
"the",
"given",
"class",
"is",
"an",
"interface",
"the",
"result",
"will",
"be",
"empty",
".",
"The",
"given",
"class",
"will",
"not",
"be",
"included",
"in",
"the",
"result",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/ClassHelper.java#L53-L55 |
116,654 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/cache/MessageCacheImpl.java | MessageCacheImpl.clean | public void clean() {
Instant minAge = Instant.now().minus(storageTimeInSeconds, ChronoUnit.SECONDS);
synchronized (messages) {
messages.removeIf(messageRef -> Optional.ofNullable(messageRef.get())
.map(message -> !message.isCachedForever() && message.getCreationTimestamp... | java | public void clean() {
Instant minAge = Instant.now().minus(storageTimeInSeconds, ChronoUnit.SECONDS);
synchronized (messages) {
messages.removeIf(messageRef -> Optional.ofNullable(messageRef.get())
.map(message -> !message.isCachedForever() && message.getCreationTimestamp... | [
"public",
"void",
"clean",
"(",
")",
"{",
"Instant",
"minAge",
"=",
"Instant",
".",
"now",
"(",
")",
".",
"minus",
"(",
"storageTimeInSeconds",
",",
"ChronoUnit",
".",
"SECONDS",
")",
";",
"synchronized",
"(",
"messages",
")",
"{",
"messages",
".",
"remo... | Cleans the cache. | [
"Cleans",
"the",
"cache",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/cache/MessageCacheImpl.java#L168-L186 |
116,655 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/embed/EmbedBuilderDelegateImpl.java | EmbedBuilderDelegateImpl.getRequiredAttachments | public List<FileContainer> getRequiredAttachments() {
List<FileContainer> requiredAttachments = new ArrayList<>();
if (footerIconContainer != null) {
requiredAttachments.add(footerIconContainer);
}
if (imageContainer != null) {
requiredAttachments.add(imageContain... | java | public List<FileContainer> getRequiredAttachments() {
List<FileContainer> requiredAttachments = new ArrayList<>();
if (footerIconContainer != null) {
requiredAttachments.add(footerIconContainer);
}
if (imageContainer != null) {
requiredAttachments.add(imageContain... | [
"public",
"List",
"<",
"FileContainer",
">",
"getRequiredAttachments",
"(",
")",
"{",
"List",
"<",
"FileContainer",
">",
"requiredAttachments",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"footerIconContainer",
"!=",
"null",
")",
"{",
"requiredAtt... | Gets the required attachments for this embed.
@return The required attachments for this embed. | [
"Gets",
"the",
"required",
"attachments",
"for",
"this",
"embed",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/embed/EmbedBuilderDelegateImpl.java#L457-L472 |
116,656 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/logging/LoggerUtil.java | LoggerUtil.getLogger | public static Logger getLogger(String name) {
AtomicBoolean logWarning = new AtomicBoolean(false);
initialized.updateAndGet(initialized -> {
if (!initialized && !ProviderUtil.hasProviders()) {
noLogger.set(true);
logWarning.set(true);
}
... | java | public static Logger getLogger(String name) {
AtomicBoolean logWarning = new AtomicBoolean(false);
initialized.updateAndGet(initialized -> {
if (!initialized && !ProviderUtil.hasProviders()) {
noLogger.set(true);
logWarning.set(true);
}
... | [
"public",
"static",
"Logger",
"getLogger",
"(",
"String",
"name",
")",
"{",
"AtomicBoolean",
"logWarning",
"=",
"new",
"AtomicBoolean",
"(",
"false",
")",
";",
"initialized",
".",
"updateAndGet",
"(",
"initialized",
"->",
"{",
"if",
"(",
"!",
"initialized",
... | Get or create a logger with the given name.
@param name The name of the logger.
@return The logger with the given name. | [
"Get",
"or",
"create",
"a",
"logger",
"with",
"the",
"given",
"name",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/logging/LoggerUtil.java#L32-L57 |
116,657 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/util/logging/FallbackLoggerConfiguration.java | FallbackLoggerConfiguration.setDebug | public static void setDebug(boolean debug) {
FallbackLoggerConfiguration.debug.set(debug);
if (!debug) {
trace.set(false);
}
} | java | public static void setDebug(boolean debug) {
FallbackLoggerConfiguration.debug.set(debug);
if (!debug) {
trace.set(false);
}
} | [
"public",
"static",
"void",
"setDebug",
"(",
"boolean",
"debug",
")",
"{",
"FallbackLoggerConfiguration",
".",
"debug",
".",
"set",
"(",
"debug",
")",
";",
"if",
"(",
"!",
"debug",
")",
"{",
"trace",
".",
"set",
"(",
"false",
")",
";",
"}",
"}"
] | Sets whether debug logging should be enabled.
Disabling debug logging automatically disables trace logging, too.
@param debug Whether debug logging should be enabled or not. | [
"Sets",
"whether",
"debug",
"logging",
"should",
"be",
"enabled",
".",
"Disabling",
"debug",
"logging",
"automatically",
"disables",
"trace",
"logging",
"too",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/util/logging/FallbackLoggerConfiguration.java#L33-L38 |
116,658 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/util/logging/FallbackLoggerConfiguration.java | FallbackLoggerConfiguration.setTrace | public static void setTrace(boolean trace) {
FallbackLoggerConfiguration.trace.set(trace);
if (trace) {
debug.set(true);
}
} | java | public static void setTrace(boolean trace) {
FallbackLoggerConfiguration.trace.set(trace);
if (trace) {
debug.set(true);
}
} | [
"public",
"static",
"void",
"setTrace",
"(",
"boolean",
"trace",
")",
"{",
"FallbackLoggerConfiguration",
".",
"trace",
".",
"set",
"(",
"trace",
")",
";",
"if",
"(",
"trace",
")",
"{",
"debug",
".",
"set",
"(",
"true",
")",
";",
"}",
"}"
] | Sets whether trace logging should be enabled.
Enabling trace logging automatically enables debug logging, too.
@param trace Whether trace logging should be enabled or not. | [
"Sets",
"whether",
"trace",
"logging",
"should",
"be",
"enabled",
".",
"Enabling",
"trace",
"logging",
"automatically",
"enables",
"debug",
"logging",
"too",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/util/logging/FallbackLoggerConfiguration.java#L55-L60 |
116,659 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java | ChannelDeleteHandler.handleServerVoiceChannel | private void handleServerVoiceChannel(JsonNode channelJson) {
long serverId = channelJson.get("guild_id").asLong();
long channelId = channelJson.get("id").asLong();
api.getPossiblyUnreadyServerById(serverId)
.ifPresent(server -> server.getVoiceChannelById(channelId).ifPresent(cha... | java | private void handleServerVoiceChannel(JsonNode channelJson) {
long serverId = channelJson.get("guild_id").asLong();
long channelId = channelJson.get("id").asLong();
api.getPossiblyUnreadyServerById(serverId)
.ifPresent(server -> server.getVoiceChannelById(channelId).ifPresent(cha... | [
"private",
"void",
"handleServerVoiceChannel",
"(",
"JsonNode",
"channelJson",
")",
"{",
"long",
"serverId",
"=",
"channelJson",
".",
"get",
"(",
"\"guild_id\"",
")",
".",
"asLong",
"(",
")",
";",
"long",
"channelId",
"=",
"channelJson",
".",
"get",
"(",
"\"... | Handles server voice channel deletion.
@param channelJson The channel data. | [
"Handles",
"server",
"voice",
"channel",
"deletion",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java#L127-L139 |
116,660 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java | ChannelDeleteHandler.handlePrivateChannel | private void handlePrivateChannel(JsonNode channel) {
UserImpl recipient = (UserImpl) api.getOrCreateUser(channel.get("recipients").get(0));
recipient.getPrivateChannel().ifPresent(privateChannel -> {
PrivateChannelDeleteEvent event = new PrivateChannelDeleteEventImpl(privateChannel);
... | java | private void handlePrivateChannel(JsonNode channel) {
UserImpl recipient = (UserImpl) api.getOrCreateUser(channel.get("recipients").get(0));
recipient.getPrivateChannel().ifPresent(privateChannel -> {
PrivateChannelDeleteEvent event = new PrivateChannelDeleteEventImpl(privateChannel);
... | [
"private",
"void",
"handlePrivateChannel",
"(",
"JsonNode",
"channel",
")",
"{",
"UserImpl",
"recipient",
"=",
"(",
"UserImpl",
")",
"api",
".",
"getOrCreateUser",
"(",
"channel",
".",
"get",
"(",
"\"recipients\"",
")",
".",
"get",
"(",
"0",
")",
")",
";",... | Handles a private channel deletion.
@param channel The channel data. | [
"Handles",
"a",
"private",
"channel",
"deletion",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java#L146-L163 |
116,661 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java | ChannelDeleteHandler.handleGroupChannel | private void handleGroupChannel(JsonNode channel) {
long channelId = channel.get("id").asLong();
api.getGroupChannelById(channelId).ifPresent(groupChannel -> {
GroupChannelDeleteEvent event = new GroupChannelDeleteEventImpl(groupChannel);
api.getEventDispatcher().dispatchGroupC... | java | private void handleGroupChannel(JsonNode channel) {
long channelId = channel.get("id").asLong();
api.getGroupChannelById(channelId).ifPresent(groupChannel -> {
GroupChannelDeleteEvent event = new GroupChannelDeleteEventImpl(groupChannel);
api.getEventDispatcher().dispatchGroupC... | [
"private",
"void",
"handleGroupChannel",
"(",
"JsonNode",
"channel",
")",
"{",
"long",
"channelId",
"=",
"channel",
".",
"get",
"(",
"\"id\"",
")",
".",
"asLong",
"(",
")",
";",
"api",
".",
"getGroupChannelById",
"(",
"channelId",
")",
".",
"ifPresent",
"(... | Handles a group channel deletion.
@param channel The channel data. | [
"Handles",
"a",
"group",
"channel",
"deletion",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java#L170-L187 |
116,662 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java | ChannelDeleteHandler.dispatchServerChannelDeleteEvent | private void dispatchServerChannelDeleteEvent(ServerChannel channel) {
ServerChannelDeleteEvent event = new ServerChannelDeleteEventImpl(channel);
api.getEventDispatcher().dispatchServerChannelDeleteEvent(
(DispatchQueueSelector) channel.getServer(), channel.getServer(), channel, event)... | java | private void dispatchServerChannelDeleteEvent(ServerChannel channel) {
ServerChannelDeleteEvent event = new ServerChannelDeleteEventImpl(channel);
api.getEventDispatcher().dispatchServerChannelDeleteEvent(
(DispatchQueueSelector) channel.getServer(), channel.getServer(), channel, event)... | [
"private",
"void",
"dispatchServerChannelDeleteEvent",
"(",
"ServerChannel",
"channel",
")",
"{",
"ServerChannelDeleteEvent",
"event",
"=",
"new",
"ServerChannelDeleteEventImpl",
"(",
"channel",
")",
";",
"api",
".",
"getEventDispatcher",
"(",
")",
".",
"dispatchServerC... | Dispatches a server channel delete event.
@param channel The channel of the event. | [
"Dispatches",
"a",
"server",
"channel",
"delete",
"event",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelDeleteHandler.java#L194-L199 |
116,663 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/FileContainer.java | FileContainer.asByteArray | public CompletableFuture<byte[]> asByteArray(DiscordApi api) {
CompletableFuture<byte[]> future = new CompletableFuture<>();
try {
if (fileAsByteArray != null) {
future.complete(fileAsByteArray);
return future;
}
if (fileAsBufferedImage... | java | public CompletableFuture<byte[]> asByteArray(DiscordApi api) {
CompletableFuture<byte[]> future = new CompletableFuture<>();
try {
if (fileAsByteArray != null) {
future.complete(fileAsByteArray);
return future;
}
if (fileAsBufferedImage... | [
"public",
"CompletableFuture",
"<",
"byte",
"[",
"]",
">",
"asByteArray",
"(",
"DiscordApi",
"api",
")",
"{",
"CompletableFuture",
"<",
"byte",
"[",
"]",
">",
"future",
"=",
"new",
"CompletableFuture",
"<>",
"(",
")",
";",
"try",
"{",
"if",
"(",
"fileAsB... | Gets the byte array for the file.
@param api The discord api instance.
@return The byte array stream for the file. | [
"Gets",
"the",
"byte",
"array",
"for",
"the",
"file",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/FileContainer.java#L232-L272 |
116,664 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/FileContainer.java | FileContainer.asInputStream | public CompletableFuture<InputStream> asInputStream(DiscordApi api) {
CompletableFuture<InputStream> future = new CompletableFuture<>();
try {
if (fileAsBufferedImage != null) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(fileAsBuffer... | java | public CompletableFuture<InputStream> asInputStream(DiscordApi api) {
CompletableFuture<InputStream> future = new CompletableFuture<>();
try {
if (fileAsBufferedImage != null) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(fileAsBuffer... | [
"public",
"CompletableFuture",
"<",
"InputStream",
">",
"asInputStream",
"(",
"DiscordApi",
"api",
")",
"{",
"CompletableFuture",
"<",
"InputStream",
">",
"future",
"=",
"new",
"CompletableFuture",
"<>",
"(",
")",
";",
"try",
"{",
"if",
"(",
"fileAsBufferedImage... | Gets the input stream for the file.
@param api The discord api instance.
@return The input stream for the file. | [
"Gets",
"the",
"input",
"stream",
"for",
"the",
"file",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/FileContainer.java#L280-L323 |
116,665 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/channel/ServerChannelUpdater.java | ServerChannelUpdater.addPermissionOverwrite | public <T extends Permissionable & DiscordEntity> ServerChannelUpdater addPermissionOverwrite(
T permissionable, Permissions permissions) {
delegate.addPermissionOverwrite(permissionable, permissions);
return this;
} | java | public <T extends Permissionable & DiscordEntity> ServerChannelUpdater addPermissionOverwrite(
T permissionable, Permissions permissions) {
delegate.addPermissionOverwrite(permissionable, permissions);
return this;
} | [
"public",
"<",
"T",
"extends",
"Permissionable",
"&",
"DiscordEntity",
">",
"ServerChannelUpdater",
"addPermissionOverwrite",
"(",
"T",
"permissionable",
",",
"Permissions",
"permissions",
")",
"{",
"delegate",
".",
"addPermissionOverwrite",
"(",
"permissionable",
",",
... | Adds a permission overwrite for the given entity.
@param <T> The type of entity to hold the permission, usually <code>User</code> or <code>Role</code>
@param permissionable The entity whose permissions should be overwritten.
@param permissions The permission overwrites.
@return The current instance in order to chain c... | [
"Adds",
"a",
"permission",
"overwrite",
"for",
"the",
"given",
"entity",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/channel/ServerChannelUpdater.java#L80-L84 |
116,666 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/permission/PermissionsBuilder.java | PermissionsBuilder.setState | public PermissionsBuilder setState(PermissionType type, PermissionState state) {
delegate.setState(type, state);
return this;
} | java | public PermissionsBuilder setState(PermissionType type, PermissionState state) {
delegate.setState(type, state);
return this;
} | [
"public",
"PermissionsBuilder",
"setState",
"(",
"PermissionType",
"type",
",",
"PermissionState",
"state",
")",
"{",
"delegate",
".",
"setState",
"(",
"type",
",",
"state",
")",
";",
"return",
"this",
";",
"}"
] | Sets the new state of the given type.
@param type The type to change.
@param state The state to set.
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"new",
"state",
"of",
"the",
"given",
"type",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/permission/PermissionsBuilder.java#L39-L42 |
116,667 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/emoji/UnicodeEmojiImpl.java | UnicodeEmojiImpl.fromString | public static UnicodeEmojiImpl fromString(String emoji) {
return unicodeEmojis.computeIfAbsent(emoji, key -> new UnicodeEmojiImpl(emoji));
} | java | public static UnicodeEmojiImpl fromString(String emoji) {
return unicodeEmojis.computeIfAbsent(emoji, key -> new UnicodeEmojiImpl(emoji));
} | [
"public",
"static",
"UnicodeEmojiImpl",
"fromString",
"(",
"String",
"emoji",
")",
"{",
"return",
"unicodeEmojis",
".",
"computeIfAbsent",
"(",
"emoji",
",",
"key",
"->",
"new",
"UnicodeEmojiImpl",
"(",
"emoji",
")",
")",
";",
"}"
] | Gets a unicode emoji by its string representation.
@param emoji The emoji string.
@return The object, representing the emoji from the given string. | [
"Gets",
"a",
"unicode",
"emoji",
"by",
"its",
"string",
"representation",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/emoji/UnicodeEmojiImpl.java#L41-L43 |
116,668 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.setFooter | public EmbedBuilder setFooter(String text, InputStream icon) {
delegate.setFooter(text, icon);
return this;
} | java | public EmbedBuilder setFooter(String text, InputStream icon) {
delegate.setFooter(text, icon);
return this;
} | [
"public",
"EmbedBuilder",
"setFooter",
"(",
"String",
"text",
",",
"InputStream",
"icon",
")",
"{",
"delegate",
".",
"setFooter",
"(",
"text",
",",
"icon",
")",
";",
"return",
"this",
";",
"}"
] | Sets the footer of the embed.
This method assumes the file type is "png"!
@param text The text of the footer.
@param icon The footer's icon.
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"footer",
"of",
"the",
"embed",
".",
"This",
"method",
"assumes",
"the",
"file",
"type",
"is",
"png",
"!"
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L156-L159 |
116,669 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.addInlineField | public EmbedBuilder addInlineField(String name, String value) {
delegate.addField(name, value, true);
return this;
} | java | public EmbedBuilder addInlineField(String name, String value) {
delegate.addField(name, value, true);
return this;
} | [
"public",
"EmbedBuilder",
"addInlineField",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"delegate",
".",
"addField",
"(",
"name",
",",
"value",
",",
"true",
")",
";",
"return",
"this",
";",
"}"
] | Adds an inline field to the embed.
@param name The name of the field.
@param value The value of the field.
@return The current instance in order to chain call methods. | [
"Adds",
"an",
"inline",
"field",
"to",
"the",
"embed",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L599-L602 |
116,670 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.addField | public EmbedBuilder addField(String name, String value) {
delegate.addField(name, value, false);
return this;
} | java | public EmbedBuilder addField(String name, String value) {
delegate.addField(name, value, false);
return this;
} | [
"public",
"EmbedBuilder",
"addField",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"delegate",
".",
"addField",
"(",
"name",
",",
"value",
",",
"false",
")",
";",
"return",
"this",
";",
"}"
] | Adds a non-inline field to the embed.
@param name The name of the field.
@param value The value of the field.
@return The current instance in order to chain call methods. | [
"Adds",
"a",
"non",
"-",
"inline",
"field",
"to",
"the",
"embed",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L611-L614 |
116,671 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.addField | public EmbedBuilder addField(String name, String value, boolean inline) {
delegate.addField(name, value, inline);
return this;
} | java | public EmbedBuilder addField(String name, String value, boolean inline) {
delegate.addField(name, value, inline);
return this;
} | [
"public",
"EmbedBuilder",
"addField",
"(",
"String",
"name",
",",
"String",
"value",
",",
"boolean",
"inline",
")",
"{",
"delegate",
".",
"addField",
"(",
"name",
",",
"value",
",",
"inline",
")",
";",
"return",
"this",
";",
"}"
] | Adds a field to the embed.
@param name The name of the field.
@param value The value of the field.
@param inline Whether the field should be inline or not.
@return The current instance in order to chain call methods. | [
"Adds",
"a",
"field",
"to",
"the",
"embed",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L624-L627 |
116,672 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.updateFields | public EmbedBuilder updateFields(Predicate<EmbedField> predicate, Consumer<EditableEmbedField> updater) {
delegate.updateFields(predicate, updater);
return this;
} | java | public EmbedBuilder updateFields(Predicate<EmbedField> predicate, Consumer<EditableEmbedField> updater) {
delegate.updateFields(predicate, updater);
return this;
} | [
"public",
"EmbedBuilder",
"updateFields",
"(",
"Predicate",
"<",
"EmbedField",
">",
"predicate",
",",
"Consumer",
"<",
"EditableEmbedField",
">",
"updater",
")",
"{",
"delegate",
".",
"updateFields",
"(",
"predicate",
",",
"updater",
")",
";",
"return",
"this",
... | Updates all fields of the embed that satisfy the given predicate using the given updater.
@param predicate The predicate that fields have to satisfy to get updated.
@param updater The updater for the fields; the {@code EditableEmbedField} is only valid during the run of the
updater; any try to save it in a variable an... | [
"Updates",
"all",
"fields",
"of",
"the",
"embed",
"that",
"satisfy",
"the",
"given",
"predicate",
"using",
"the",
"given",
"updater",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L638-L641 |
116,673 | Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.updateAllFields | public EmbedBuilder updateAllFields(Consumer<EditableEmbedField> updater) {
delegate.updateFields(field -> true, updater);
return this;
} | java | public EmbedBuilder updateAllFields(Consumer<EditableEmbedField> updater) {
delegate.updateFields(field -> true, updater);
return this;
} | [
"public",
"EmbedBuilder",
"updateAllFields",
"(",
"Consumer",
"<",
"EditableEmbedField",
">",
"updater",
")",
"{",
"delegate",
".",
"updateFields",
"(",
"field",
"->",
"true",
",",
"updater",
")",
";",
"return",
"this",
";",
"}"
] | Updates all fields of the embed using the given updater.
@param updater The updater for the fields; the {@code EditableEmbedField} is only valid during the run of the
updater; any try to save it in a variable and reuse it later after this method call will fail
with exceptions.
@return The current instance in order to ... | [
"Updates",
"all",
"fields",
"of",
"the",
"embed",
"using",
"the",
"given",
"updater",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L651-L654 |
116,674 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/ratelimit/RatelimitManager.java | RatelimitManager.handleResponse | private void handleResponse(
RestRequest<?> request, RestRequestResult result, RatelimitBucket bucket, long responseTimestamp) {
if (result == null || result.getResponse() == null) {
return;
}
Response response = result.getResponse();
boolean global = response.hea... | java | private void handleResponse(
RestRequest<?> request, RestRequestResult result, RatelimitBucket bucket, long responseTimestamp) {
if (result == null || result.getResponse() == null) {
return;
}
Response response = result.getResponse();
boolean global = response.hea... | [
"private",
"void",
"handleResponse",
"(",
"RestRequest",
"<",
"?",
">",
"request",
",",
"RestRequestResult",
"result",
",",
"RatelimitBucket",
"bucket",
",",
"long",
"responseTimestamp",
")",
"{",
"if",
"(",
"result",
"==",
"null",
"||",
"result",
".",
"getRes... | Updates the ratelimit information and sets the result if the request was successful.
@param request The request.
@param result The result of the request.
@param bucket The bucket the request belongs to.
@param responseTimestamp The timestamp directly after the response finished. | [
"Updates",
"the",
"ratelimit",
"information",
"and",
"sets",
"the",
"result",
"if",
"the",
"request",
"was",
"successful",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/ratelimit/RatelimitManager.java#L160-L204 |
116,675 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/ratelimit/RatelimitManager.java | RatelimitManager.calculateOffset | private void calculateOffset(long currentTime, RestRequestResult result) {
// Double-checked locking for better performance
if ((api.getTimeOffset() != null) || (result == null) || (result.getResponse() == null)) {
return;
}
synchronized (api) {
if (api.getTimeOff... | java | private void calculateOffset(long currentTime, RestRequestResult result) {
// Double-checked locking for better performance
if ((api.getTimeOffset() != null) || (result == null) || (result.getResponse() == null)) {
return;
}
synchronized (api) {
if (api.getTimeOff... | [
"private",
"void",
"calculateOffset",
"(",
"long",
"currentTime",
",",
"RestRequestResult",
"result",
")",
"{",
"// Double-checked locking for better performance",
"if",
"(",
"(",
"api",
".",
"getTimeOffset",
"(",
")",
"!=",
"null",
")",
"||",
"(",
"result",
"==",... | Calculates the offset of the local time and discord's time.
@param currentTime The current time.
@param result The result of the rest request. | [
"Calculates",
"the",
"offset",
"of",
"the",
"local",
"time",
"and",
"discord",
"s",
"time",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/ratelimit/RatelimitManager.java#L212-L230 |
116,676 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java | RestRequest.getMajorUrlParameter | public Optional<String> getMajorUrlParameter() {
if (customMajorParam != null) {
return Optional.of(customMajorParam);
}
Optional<Integer> majorParameterPosition = endpoint.getMajorParameterPosition();
if (!majorParameterPosition.isPresent()) {
return Optional.emp... | java | public Optional<String> getMajorUrlParameter() {
if (customMajorParam != null) {
return Optional.of(customMajorParam);
}
Optional<Integer> majorParameterPosition = endpoint.getMajorParameterPosition();
if (!majorParameterPosition.isPresent()) {
return Optional.emp... | [
"public",
"Optional",
"<",
"String",
">",
"getMajorUrlParameter",
"(",
")",
"{",
"if",
"(",
"customMajorParam",
"!=",
"null",
")",
"{",
"return",
"Optional",
".",
"of",
"(",
"customMajorParam",
")",
";",
"}",
"Optional",
"<",
"Integer",
">",
"majorParameterP... | Gets the major url parameter of this request.
If an request has a major parameter, it means that the ratelimits for this request are based on this parameter.
@return The major url parameter used for ratelimits. | [
"Gets",
"the",
"major",
"url",
"parameter",
"of",
"this",
"request",
".",
"If",
"an",
"request",
"has",
"a",
"major",
"parameter",
"it",
"means",
"that",
"the",
"ratelimits",
"for",
"this",
"request",
"are",
"based",
"on",
"this",
"parameter",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java#L129-L141 |
116,677 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java | RestRequest.addQueryParameter | public RestRequest<T> addQueryParameter(String key, String value) {
queryParameters.put(key, value);
return this;
} | java | public RestRequest<T> addQueryParameter(String key, String value) {
queryParameters.put(key, value);
return this;
} | [
"public",
"RestRequest",
"<",
"T",
">",
"addQueryParameter",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"queryParameters",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a query parameter to the url.
@param key The key of the parameter.
@param value The value of the parameter.
@return The current instance in order to chain call methods. | [
"Adds",
"a",
"query",
"parameter",
"to",
"the",
"url",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java#L159-L162 |
116,678 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java | RestRequest.execute | public CompletableFuture<T> execute(Function<RestRequestResult, T> function) {
api.getRatelimitManager().queueRequest(this);
CompletableFuture<T> future = new CompletableFuture<>();
result.whenComplete((result, throwable) -> {
if (throwable != null) {
future.completeE... | java | public CompletableFuture<T> execute(Function<RestRequestResult, T> function) {
api.getRatelimitManager().queueRequest(this);
CompletableFuture<T> future = new CompletableFuture<>();
result.whenComplete((result, throwable) -> {
if (throwable != null) {
future.completeE... | [
"public",
"CompletableFuture",
"<",
"T",
">",
"execute",
"(",
"Function",
"<",
"RestRequestResult",
",",
"T",
">",
"function",
")",
"{",
"api",
".",
"getRatelimitManager",
"(",
")",
".",
"queueRequest",
"(",
"this",
")",
";",
"CompletableFuture",
"<",
"T",
... | Executes the request. This will automatically retry if we hit a ratelimit.
@param function A function which processes the rest response to the requested object.
@return A future which will contain the output of the function. | [
"Executes",
"the",
"request",
".",
"This",
"will",
"automatically",
"retry",
"if",
"we",
"hit",
"a",
"ratelimit",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java#L261-L276 |
116,679 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java | RestRequest.asRestRequestInformation | public RestRequestInformation asRestRequestInformation() {
try {
return new RestRequestInformationImpl(
api, new URL(endpoint.getFullUrl(urlParameters)), queryParameters, headers, body);
} catch (MalformedURLException e) {
throw new AssertionError(e);
... | java | public RestRequestInformation asRestRequestInformation() {
try {
return new RestRequestInformationImpl(
api, new URL(endpoint.getFullUrl(urlParameters)), queryParameters, headers, body);
} catch (MalformedURLException e) {
throw new AssertionError(e);
... | [
"public",
"RestRequestInformation",
"asRestRequestInformation",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"RestRequestInformationImpl",
"(",
"api",
",",
"new",
"URL",
"(",
"endpoint",
".",
"getFullUrl",
"(",
"urlParameters",
")",
")",
",",
"queryParameters",
","... | Gets the information for this rest request.
@return The information for this rest request. | [
"Gets",
"the",
"information",
"for",
"this",
"rest",
"request",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/rest/RestRequest.java#L292-L299 |
116,680 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java | ChannelUpdateHandler.handleChannelCategory | private void handleChannelCategory(JsonNode jsonChannel) {
long channelCategoryId = jsonChannel.get("id").asLong();
api.getChannelCategoryById(channelCategoryId).map(ChannelCategoryImpl.class::cast).ifPresent(channel -> {
boolean oldNsfwFlag = channel.isNsfw();
boolean newNsfwFla... | java | private void handleChannelCategory(JsonNode jsonChannel) {
long channelCategoryId = jsonChannel.get("id").asLong();
api.getChannelCategoryById(channelCategoryId).map(ChannelCategoryImpl.class::cast).ifPresent(channel -> {
boolean oldNsfwFlag = channel.isNsfw();
boolean newNsfwFla... | [
"private",
"void",
"handleChannelCategory",
"(",
"JsonNode",
"jsonChannel",
")",
"{",
"long",
"channelCategoryId",
"=",
"jsonChannel",
".",
"get",
"(",
"\"id\"",
")",
".",
"asLong",
"(",
")",
";",
"api",
".",
"getChannelCategoryById",
"(",
"channelCategoryId",
"... | Handles a channel category update.
@param jsonChannel The channel data. | [
"Handles",
"a",
"channel",
"category",
"update",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java#L251-L265 |
116,681 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java | ChannelUpdateHandler.handleServerTextChannel | private void handleServerTextChannel(JsonNode jsonChannel) {
long channelId = jsonChannel.get("id").asLong();
api.getTextChannelById(channelId).map(c -> ((ServerTextChannelImpl) c)).ifPresent(channel -> {
String oldTopic = channel.getTopic();
String newTopic = jsonChannel.has("to... | java | private void handleServerTextChannel(JsonNode jsonChannel) {
long channelId = jsonChannel.get("id").asLong();
api.getTextChannelById(channelId).map(c -> ((ServerTextChannelImpl) c)).ifPresent(channel -> {
String oldTopic = channel.getTopic();
String newTopic = jsonChannel.has("to... | [
"private",
"void",
"handleServerTextChannel",
"(",
"JsonNode",
"jsonChannel",
")",
"{",
"long",
"channelId",
"=",
"jsonChannel",
".",
"get",
"(",
"\"id\"",
")",
".",
"asLong",
"(",
")",
";",
"api",
".",
"getTextChannelById",
"(",
"channelId",
")",
".",
"map"... | Handles a server text channel update.
@param jsonChannel The json channel data. | [
"Handles",
"a",
"server",
"text",
"channel",
"update",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java#L272-L311 |
116,682 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java | ChannelUpdateHandler.handleServerVoiceChannel | private void handleServerVoiceChannel(JsonNode jsonChannel) {
long channelId = jsonChannel.get("id").asLong();
api.getServerVoiceChannelById(channelId).map(ServerVoiceChannelImpl.class::cast).ifPresent(channel -> {
int oldBitrate = channel.getBitrate();
int newBitrate = jsonChann... | java | private void handleServerVoiceChannel(JsonNode jsonChannel) {
long channelId = jsonChannel.get("id").asLong();
api.getServerVoiceChannelById(channelId).map(ServerVoiceChannelImpl.class::cast).ifPresent(channel -> {
int oldBitrate = channel.getBitrate();
int newBitrate = jsonChann... | [
"private",
"void",
"handleServerVoiceChannel",
"(",
"JsonNode",
"jsonChannel",
")",
"{",
"long",
"channelId",
"=",
"jsonChannel",
".",
"get",
"(",
"\"id\"",
")",
".",
"asLong",
"(",
")",
";",
"api",
".",
"getServerVoiceChannelById",
"(",
"channelId",
")",
".",... | Handles a server voice channel update.
@param jsonChannel The channel data. | [
"Handles",
"a",
"server",
"voice",
"channel",
"update",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java#L318-L343 |
116,683 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java | ChannelUpdateHandler.handleGroupChannel | private void handleGroupChannel(JsonNode jsonChannel) {
long channelId = jsonChannel.get("id").asLong();
api.getGroupChannelById(channelId).map(GroupChannelImpl.class::cast).ifPresent(channel -> {
String oldName = channel.getName().orElseThrow(AssertionError::new);
String newName... | java | private void handleGroupChannel(JsonNode jsonChannel) {
long channelId = jsonChannel.get("id").asLong();
api.getGroupChannelById(channelId).map(GroupChannelImpl.class::cast).ifPresent(channel -> {
String oldName = channel.getName().orElseThrow(AssertionError::new);
String newName... | [
"private",
"void",
"handleGroupChannel",
"(",
"JsonNode",
"jsonChannel",
")",
"{",
"long",
"channelId",
"=",
"jsonChannel",
".",
"get",
"(",
"\"id\"",
")",
".",
"asLong",
"(",
")",
";",
"api",
".",
"getGroupChannelById",
"(",
"channelId",
")",
".",
"map",
... | Handles a group channel update.
@param jsonChannel The channel data. | [
"Handles",
"a",
"group",
"channel",
"update",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java#L358-L373 |
116,684 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java | ChannelUpdateHandler.dispatchServerChannelChangeOverwrittenPermissionsEvent | private void dispatchServerChannelChangeOverwrittenPermissionsEvent(
ServerChannel channel, Permissions newPermissions, Permissions oldPermissions, DiscordEntity entity) {
if (newPermissions.equals(oldPermissions)) {
// This can be caused by adding a user/role in a channels overwritten p... | java | private void dispatchServerChannelChangeOverwrittenPermissionsEvent(
ServerChannel channel, Permissions newPermissions, Permissions oldPermissions, DiscordEntity entity) {
if (newPermissions.equals(oldPermissions)) {
// This can be caused by adding a user/role in a channels overwritten p... | [
"private",
"void",
"dispatchServerChannelChangeOverwrittenPermissionsEvent",
"(",
"ServerChannel",
"channel",
",",
"Permissions",
"newPermissions",
",",
"Permissions",
"oldPermissions",
",",
"DiscordEntity",
"entity",
")",
"{",
"if",
"(",
"newPermissions",
".",
"equals",
... | Dispatches a ServerChannelChangeOverwrittenPermissionsEvent.
@param channel The channel of the event.
@param newPermissions The new overwritten permissions.
@param oldPermissions The old overwritten permissions.
@param entity The entity of the event. | [
"Dispatches",
"a",
"ServerChannelChangeOverwrittenPermissionsEvent",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java#L383-L401 |
116,685 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.purgeCache | public void purgeCache() {
synchronized (users) {
users.values().stream()
.map(Reference::get)
.filter(Objects::nonNull)
.map(Cleanupable.class::cast)
.forEach(Cleanupable::cleanup);
users.clear();
}
... | java | public void purgeCache() {
synchronized (users) {
users.values().stream()
.map(Reference::get)
.filter(Objects::nonNull)
.map(Cleanupable.class::cast)
.forEach(Cleanupable::cleanup);
users.clear();
}
... | [
"public",
"void",
"purgeCache",
"(",
")",
"{",
"synchronized",
"(",
"users",
")",
"{",
"users",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"Reference",
"::",
"get",
")",
".",
"filter",
"(",
"Objects",
"::",
"nonNull",
")",
"... | Purges all cached entities.
This method is only meant to be called after receiving a READY packet. | [
"Purges",
"all",
"cached",
"entities",
".",
"This",
"method",
"is",
"only",
"meant",
"to",
"be",
"called",
"after",
"receiving",
"a",
"READY",
"packet",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L614-L638 |
116,686 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.getAllServers | public Collection<Server> getAllServers() {
ArrayList<Server> allServers = new ArrayList<>(nonReadyServers.values());
allServers.addAll(servers.values());
return Collections.unmodifiableList(allServers);
} | java | public Collection<Server> getAllServers() {
ArrayList<Server> allServers = new ArrayList<>(nonReadyServers.values());
allServers.addAll(servers.values());
return Collections.unmodifiableList(allServers);
} | [
"public",
"Collection",
"<",
"Server",
">",
"getAllServers",
"(",
")",
"{",
"ArrayList",
"<",
"Server",
">",
"allServers",
"=",
"new",
"ArrayList",
"<>",
"(",
"nonReadyServers",
".",
"values",
"(",
")",
")",
";",
"allServers",
".",
"addAll",
"(",
"servers"... | Gets a collection with all servers, including ready and not ready ones.
@return A collection with all servers. | [
"Gets",
"a",
"collection",
"with",
"all",
"servers",
"including",
"ready",
"and",
"not",
"ready",
"ones",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L645-L649 |
116,687 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.getPossiblyUnreadyServerById | public Optional<Server> getPossiblyUnreadyServerById(long id) {
if (nonReadyServers.containsKey(id)) {
return Optional.ofNullable(nonReadyServers.get(id));
}
return Optional.ofNullable(servers.get(id));
} | java | public Optional<Server> getPossiblyUnreadyServerById(long id) {
if (nonReadyServers.containsKey(id)) {
return Optional.ofNullable(nonReadyServers.get(id));
}
return Optional.ofNullable(servers.get(id));
} | [
"public",
"Optional",
"<",
"Server",
">",
"getPossiblyUnreadyServerById",
"(",
"long",
"id",
")",
"{",
"if",
"(",
"nonReadyServers",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"nonReadyServers",
".",
"get",
"(... | Gets a server by it's id, including ready and not ready ones.
@param id The of the server.
@return The server with the given id. | [
"Gets",
"a",
"server",
"by",
"it",
"s",
"id",
"including",
"ready",
"and",
"not",
"ready",
"ones",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L657-L662 |
116,688 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.addServerToCache | public void addServerToCache(ServerImpl server) {
// Remove in case, there's an old instance in cache
removeServerFromCache(server.getId());
nonReadyServers.put(server.getId(), server);
server.addServerReadyConsumer(s -> {
nonReadyServers.remove(s.getId());
remov... | java | public void addServerToCache(ServerImpl server) {
// Remove in case, there's an old instance in cache
removeServerFromCache(server.getId());
nonReadyServers.put(server.getId(), server);
server.addServerReadyConsumer(s -> {
nonReadyServers.remove(s.getId());
remov... | [
"public",
"void",
"addServerToCache",
"(",
"ServerImpl",
"server",
")",
"{",
"// Remove in case, there's an old instance in cache",
"removeServerFromCache",
"(",
"server",
".",
"getId",
"(",
")",
")",
";",
"nonReadyServers",
".",
"put",
"(",
"server",
".",
"getId",
... | Adds the given server to the cache.
@param server The server to add. | [
"Adds",
"the",
"given",
"server",
"to",
"the",
"cache",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L669-L679 |
116,689 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.removeServerFromCache | public void removeServerFromCache(long serverId) {
servers.computeIfPresent(serverId, (key, server) -> {
((Cleanupable) server).cleanup();
return null;
});
nonReadyServers.computeIfPresent(serverId, (key, server) -> {
((Cleanupable) server).cleanup();
... | java | public void removeServerFromCache(long serverId) {
servers.computeIfPresent(serverId, (key, server) -> {
((Cleanupable) server).cleanup();
return null;
});
nonReadyServers.computeIfPresent(serverId, (key, server) -> {
((Cleanupable) server).cleanup();
... | [
"public",
"void",
"removeServerFromCache",
"(",
"long",
"serverId",
")",
"{",
"servers",
".",
"computeIfPresent",
"(",
"serverId",
",",
"(",
"key",
",",
"server",
")",
"->",
"{",
"(",
"(",
"Cleanupable",
")",
"server",
")",
".",
"cleanup",
"(",
")",
";",... | Removes the given server from the cache.
@param serverId The id of the server to remove. | [
"Removes",
"the",
"given",
"server",
"from",
"the",
"cache",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L686-L695 |
116,690 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.addUserToCache | public void addUserToCache(User user) {
users.compute(user.getId(), (key, value) -> {
Optional.ofNullable(value)
.map(Reference::get)
.filter(oldUser -> oldUser != user)
.map(Cleanupable.class::cast)
.ifPresent(Cleanupab... | java | public void addUserToCache(User user) {
users.compute(user.getId(), (key, value) -> {
Optional.ofNullable(value)
.map(Reference::get)
.filter(oldUser -> oldUser != user)
.map(Cleanupable.class::cast)
.ifPresent(Cleanupab... | [
"public",
"void",
"addUserToCache",
"(",
"User",
"user",
")",
"{",
"users",
".",
"compute",
"(",
"user",
".",
"getId",
"(",
")",
",",
"(",
"key",
",",
"value",
")",
"->",
"{",
"Optional",
".",
"ofNullable",
"(",
"value",
")",
".",
"map",
"(",
"Refe... | Adds the given user to the cache.
@param user The user to add. | [
"Adds",
"the",
"given",
"user",
"to",
"the",
"cache",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L702-L714 |
116,691 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.addChannelToCache | public void addChannelToCache(Channel channel) {
Channel oldChannel = channels.put(channel.getId(), channel);
if (oldChannel != channel && oldChannel instanceof Cleanupable) {
((Cleanupable) oldChannel).cleanup();
}
} | java | public void addChannelToCache(Channel channel) {
Channel oldChannel = channels.put(channel.getId(), channel);
if (oldChannel != channel && oldChannel instanceof Cleanupable) {
((Cleanupable) oldChannel).cleanup();
}
} | [
"public",
"void",
"addChannelToCache",
"(",
"Channel",
"channel",
")",
"{",
"Channel",
"oldChannel",
"=",
"channels",
".",
"put",
"(",
"channel",
".",
"getId",
"(",
")",
",",
"channel",
")",
";",
"if",
"(",
"oldChannel",
"!=",
"channel",
"&&",
"oldChannel"... | Adds a channel to the cache.
@param channel The channel to add. | [
"Adds",
"a",
"channel",
"to",
"the",
"cache",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L721-L726 |
116,692 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.removeChannelFromCache | public void removeChannelFromCache(long channelId) {
channels.computeIfPresent(channelId, (key, channel) -> {
if (channel instanceof Cleanupable) {
((Cleanupable) channel).cleanup();
}
return null;
});
} | java | public void removeChannelFromCache(long channelId) {
channels.computeIfPresent(channelId, (key, channel) -> {
if (channel instanceof Cleanupable) {
((Cleanupable) channel).cleanup();
}
return null;
});
} | [
"public",
"void",
"removeChannelFromCache",
"(",
"long",
"channelId",
")",
"{",
"channels",
".",
"computeIfPresent",
"(",
"channelId",
",",
"(",
"key",
",",
"channel",
")",
"->",
"{",
"if",
"(",
"channel",
"instanceof",
"Cleanupable",
")",
"{",
"(",
"(",
"... | Removes a channel from the cache.
@param channelId The id of the channel to remove. | [
"Removes",
"a",
"channel",
"from",
"the",
"cache",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L733-L740 |
116,693 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.getOrCreateUser | public User getOrCreateUser(JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
synchronized (users) {
return getCachedUserById(id).orElseGet(() -> {
if (!data.has("username")) {
throw new IllegalStateException("Couldn't get or created user... | java | public User getOrCreateUser(JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
synchronized (users) {
return getCachedUserById(id).orElseGet(() -> {
if (!data.has("username")) {
throw new IllegalStateException("Couldn't get or created user... | [
"public",
"User",
"getOrCreateUser",
"(",
"JsonNode",
"data",
")",
"{",
"long",
"id",
"=",
"Long",
".",
"parseLong",
"(",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"asText",
"(",
")",
")",
";",
"synchronized",
"(",
"users",
")",
"{",
"return",
"ge... | Gets a user or creates a new one from the given data.
@param data The json data of the user.
@return The user. | [
"Gets",
"a",
"user",
"or",
"creates",
"a",
"new",
"one",
"from",
"the",
"given",
"data",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L794-L804 |
116,694 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.getOrCreateKnownCustomEmoji | public KnownCustomEmoji getOrCreateKnownCustomEmoji(Server server, JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
return customEmojis.computeIfAbsent(id, key -> new KnownCustomEmojiImpl(this, server, data));
} | java | public KnownCustomEmoji getOrCreateKnownCustomEmoji(Server server, JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
return customEmojis.computeIfAbsent(id, key -> new KnownCustomEmojiImpl(this, server, data));
} | [
"public",
"KnownCustomEmoji",
"getOrCreateKnownCustomEmoji",
"(",
"Server",
"server",
",",
"JsonNode",
"data",
")",
"{",
"long",
"id",
"=",
"Long",
".",
"parseLong",
"(",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"asText",
"(",
")",
")",
";",
"return",
... | Gets or creates a new known custom emoji object.
@param server The server of the emoji.
@param data The data of the emoji.
@return The emoji for the given json object. | [
"Gets",
"or",
"creates",
"a",
"new",
"known",
"custom",
"emoji",
"object",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L813-L816 |
116,695 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.getOrCreateMessage | public Message getOrCreateMessage(TextChannel channel, JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
synchronized (messages) {
return getCachedMessageById(id).orElseGet(() -> new MessageImpl(this, channel, data));
}
} | java | public Message getOrCreateMessage(TextChannel channel, JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
synchronized (messages) {
return getCachedMessageById(id).orElseGet(() -> new MessageImpl(this, channel, data));
}
} | [
"public",
"Message",
"getOrCreateMessage",
"(",
"TextChannel",
"channel",
",",
"JsonNode",
"data",
")",
"{",
"long",
"id",
"=",
"Long",
".",
"parseLong",
"(",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"asText",
"(",
")",
")",
";",
"synchronized",
"(",... | Gets or creates a new message object.
@param channel The channel of the message.
@param data The data of the message.
@return The message for the given json object. | [
"Gets",
"or",
"creates",
"a",
"new",
"message",
"object",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L859-L864 |
116,696 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.addObjectListener | @SuppressWarnings("unchecked")
public <T extends ObjectAttachableListener> ListenerManager<T> addObjectListener(
Class<?> objectClass, long objectId, Class<T> listenerClass, T listener) {
Map<ObjectAttachableListener, ListenerManagerImpl<? extends ObjectAttachableListener>> listeners =
... | java | @SuppressWarnings("unchecked")
public <T extends ObjectAttachableListener> ListenerManager<T> addObjectListener(
Class<?> objectClass, long objectId, Class<T> listenerClass, T listener) {
Map<ObjectAttachableListener, ListenerManagerImpl<? extends ObjectAttachableListener>> listeners =
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"ObjectAttachableListener",
">",
"ListenerManager",
"<",
"T",
">",
"addObjectListener",
"(",
"Class",
"<",
"?",
">",
"objectClass",
",",
"long",
"objectId",
",",
"Class",
"<",
"... | Adds an object listener.
Adding a listener multiple times to the same object will only add it once
and return the same listener manager on each invocation.
The order of invocation is according to first addition.
@param objectClass The class of the object.
@param objectId The id of the object.
@param listenerClass The ... | [
"Adds",
"an",
"object",
"listener",
".",
"Adding",
"a",
"listener",
"multiple",
"times",
"to",
"the",
"same",
"object",
"will",
"only",
"add",
"it",
"once",
"and",
"return",
"the",
"same",
"listener",
"manager",
"on",
"each",
"invocation",
".",
"The",
"ord... | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L907-L917 |
116,697 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.removeObjectListener | public <T extends ObjectAttachableListener> void removeObjectListener(
Class<?> objectClass, long objectId, Class<T> listenerClass, T listener) {
synchronized (objectListeners) {
if (objectClass == null) {
return;
}
Map<Long, Map<Class<? extends Ob... | java | public <T extends ObjectAttachableListener> void removeObjectListener(
Class<?> objectClass, long objectId, Class<T> listenerClass, T listener) {
synchronized (objectListeners) {
if (objectClass == null) {
return;
}
Map<Long, Map<Class<? extends Ob... | [
"public",
"<",
"T",
"extends",
"ObjectAttachableListener",
">",
"void",
"removeObjectListener",
"(",
"Class",
"<",
"?",
">",
"objectClass",
",",
"long",
"objectId",
",",
"Class",
"<",
"T",
">",
"listenerClass",
",",
"T",
"listener",
")",
"{",
"synchronized",
... | Removes an object listener.
@param objectClass The class of the object.
@param objectId The id of the object.
@param listenerClass The listener class.
@param listener The listener to remove.
@param <T> The type of the listener. | [
"Removes",
"an",
"object",
"listener",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L928-L967 |
116,698 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.removeObjectListeners | public void removeObjectListeners(Class<?> objectClass, long objectId) {
if (objectClass == null) {
return;
}
synchronized (objectListeners) {
Map<Long, Map<Class<? extends ObjectAttachableListener>,
Map<ObjectAttachableListener, ListenerManagerImpl<? ... | java | public void removeObjectListeners(Class<?> objectClass, long objectId) {
if (objectClass == null) {
return;
}
synchronized (objectListeners) {
Map<Long, Map<Class<? extends ObjectAttachableListener>,
Map<ObjectAttachableListener, ListenerManagerImpl<? ... | [
"public",
"void",
"removeObjectListeners",
"(",
"Class",
"<",
"?",
">",
"objectClass",
",",
"long",
"objectId",
")",
"{",
"if",
"(",
"objectClass",
"==",
"null",
")",
"{",
"return",
";",
"}",
"synchronized",
"(",
"objectListeners",
")",
"{",
"Map",
"<",
... | Remove all listeners attached to an object.
@param objectClass The class of the object.
@param objectId The id of the object. | [
"Remove",
"all",
"listeners",
"attached",
"to",
"an",
"object",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L975-L999 |
116,699 | Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.getObjectListeners | @SuppressWarnings("unchecked")
public <T extends ObjectAttachableListener> List<T> getObjectListeners(
Class<?> objectClass, long objectId, Class<T> listenerClass) {
return Collections.unmodifiableList((List<T>) Optional.ofNullable(objectClass)
.map(objectListeners::get)
... | java | @SuppressWarnings("unchecked")
public <T extends ObjectAttachableListener> List<T> getObjectListeners(
Class<?> objectClass, long objectId, Class<T> listenerClass) {
return Collections.unmodifiableList((List<T>) Optional.ofNullable(objectClass)
.map(objectListeners::get)
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"ObjectAttachableListener",
">",
"List",
"<",
"T",
">",
"getObjectListeners",
"(",
"Class",
"<",
"?",
">",
"objectClass",
",",
"long",
"objectId",
",",
"Class",
"<",
"T",
">",... | Gets all object listeners of the given class.
@param objectClass The class of the object.
@param objectId The id of the object.
@param listenerClass The listener class.
@param <T> The type of the listener.
@return A list with all object listeners of the given type. | [
"Gets",
"all",
"object",
"listeners",
"of",
"the",
"given",
"class",
"."
] | 915aad084dc5e863284267529d0dccd625fc6886 | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L1040-L1050 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.