code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
public boolean hasNext() { return stack.isEmpty() ? false : true; }
@return whether we have a next smallest number
hasNext
java
kdn251/interviews
leetcode/stack/BinarySearchTreeIterator.java
https://github.com/kdn251/interviews/blob/master/leetcode/stack/BinarySearchTreeIterator.java
MIT
@Override public Integer next() { return stack.pop().getInteger(); }
// This is the interface that allows for creating nested lists. // You should not implement it, or speculate about its implementation public interface NestedInteger { // @return true if this NestedInteger holds a single integer, rather than a nested list. public boolean isInteger(); // @return the single ...
next
java
kdn251/interviews
leetcode/stack/FlattenNestedListIterator.java
https://github.com/kdn251/interviews/blob/master/leetcode/stack/FlattenNestedListIterator.java
MIT
@Override public boolean hasNext() { while(!stack.isEmpty()) { NestedInteger current = stack.peek(); if(current.isInteger()) { return true; } stack.pop(); for(int i = current.getList().size() - 1; i >= 0; i--) { ...
// This is the interface that allows for creating nested lists. // You should not implement it, or speculate about its implementation public interface NestedInteger { // @return true if this NestedInteger holds a single integer, rather than a nested list. public boolean isInteger(); // @return the single ...
hasNext
java
kdn251/interviews
leetcode/stack/FlattenNestedListIterator.java
https://github.com/kdn251/interviews/blob/master/leetcode/stack/FlattenNestedListIterator.java
MIT
public int maxPathSum(TreeNode root) { maxPathSumRecursive(root); return max; }
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
maxPathSum
java
kdn251/interviews
leetcode/tree/BinaryTreeMaximumPathSum.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/BinaryTreeMaximumPathSum.java
MIT
private int maxPathSumRecursive(TreeNode root) { if(root == null) { return 0; } int left = Math.max(maxPathSumRecursive(root.left), 0); int right = Math.max(maxPathSumRecursive(root.right), 0); max = Math.max(max, root.val + left + right); ...
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
maxPathSumRecursive
java
kdn251/interviews
leetcode/tree/BinaryTreeMaximumPathSum.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/BinaryTreeMaximumPathSum.java
MIT
public List<String> binaryTreePaths(TreeNode root) { List<String> result = new ArrayList<String>(); if(root == null) { return result; } helper(new String(), root, result); return result; }
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
binaryTreePaths
java
kdn251/interviews
leetcode/tree/BinaryTreePaths.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/BinaryTreePaths.java
MIT
public void helper(String current, TreeNode root, List<String> result) { if(root.left == null && root.right == null) { result.add(current + root.val); } if(root.left != null) { helper(current + root.val + "->", root.left, result); } if(root.right != null...
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
helper
java
kdn251/interviews
leetcode/tree/BinaryTreePaths.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/BinaryTreePaths.java
MIT
public TreeNode inorderSuccessor(TreeNode root, TreeNode p) { TreeNode successor = null; while(root != null) { if(p.val < root.val) { successor = root; root = root.left; } else { root = root.right; } } ...
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
inorderSuccessor
java
kdn251/interviews
leetcode/tree/InorderSuccessorInBST.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/InorderSuccessorInBST.java
MIT
public TreeNode invertTree(TreeNode root) { if(root == null) { return root; } TreeNode temp = root.left; root.left = invertTree(root.right); root.right = invertTree(temp); return root; }
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
invertTree
java
kdn251/interviews
leetcode/tree/InvertBinaryTree.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/InvertBinaryTree.java
MIT
public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { if(root == null || root == p || root == q) { return root; } TreeNode left = lowestCommonAncestor(root.left, p, q); TreeNode right = lowestCommonAncestor(root.right, p, q); ...
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
lowestCommonAncestor
java
kdn251/interviews
leetcode/tree/LowestCommonAncestorOfABinaryTree.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/LowestCommonAncestorOfABinaryTree.java
MIT
public int sumOfLeftLeaves(TreeNode root) { if(root == null) { return 0; } int total = 0; if(root.left != null) { if(root.left.left == null && root.left.right == null) { total += root.left.val; } else { ...
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
sumOfLeftLeaves
java
kdn251/interviews
leetcode/tree/SumOfLeftLeaves.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/SumOfLeftLeaves.java
MIT
public TreeNode trimBST(TreeNode root, int L, int R) { if(root == null) { return root; } if(root.val < L) { return trimBST(root.right, L, R); } if(root.val > R) { return trimBST(root.left, L, R); } root.left = trimBST(r...
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
trimBST
java
kdn251/interviews
leetcode/tree/TrimABinarySearchTree.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/TrimABinarySearchTree.java
MIT
public boolean isValidBST(TreeNode root) { if(root == null) { return true; } return validBSTRecursive(root, Long.MIN_VALUE, Long.MAX_VALUE); }
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
isValidBST
java
kdn251/interviews
leetcode/tree/ValidateBinarySearchTree.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/ValidateBinarySearchTree.java
MIT
public boolean validBSTRecursive(TreeNode root, long minValue, long maxValue) { if(root == null) { return true; } else if(root.val >= maxValue || root.val <= minValue) { return false; } else { return validBSTRecursive(root.left, minValue, root.val) && validBST...
Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
validBSTRecursive
java
kdn251/interviews
leetcode/tree/ValidateBinarySearchTree.java
https://github.com/kdn251/interviews/blob/master/leetcode/tree/ValidateBinarySearchTree.java
MIT
public boolean hasCycle(ListNode head) { if(head == null || head.next == null) { return false; } ListNode slow = head; ListNode fast = head.next; while(fast != null && fast.next != null && fast != slow) { slow = slow.next; fast = fast....
Definition for singly-linked list. class ListNode { int val; ListNode next; ListNode(int x) { val = x; next = null; } }
hasCycle
java
kdn251/interviews
leetcode/two-pointers/LinkedListCycle.java
https://github.com/kdn251/interviews/blob/master/leetcode/two-pointers/LinkedListCycle.java
MIT
public static void main(String[] args) { Scanner input = new Scanner(System.in); int numberOfTestCases = input.nextInt(); while (numberOfTestCases != 0) { int[] numbers = new int[10]; int number = input.nextInt(); for (int i = number; i > 0; i--) { int j = i; while (j != 0) { numbers[j % 10]...
Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 to N (1 < N < 10000). After that, he counts the number of times each digit (0 to 9) appears in the sequence. For example, with N = 13, the sequence is: 12345678910111213 In this...
main
java
kdn251/interviews
uva/DigitCounting.java
https://github.com/kdn251/interviews/blob/master/uva/DigitCounting.java
MIT
public static void premain(String agentArgs, Instrumentation inst) { agentmain(agentArgs, inst); }
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
premain
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
public static void agentmain(String agentArgs, Instrumentation inst) { init(inst, agentArgs); }
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
agentmain
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
private static void init(Instrumentation inst, String agentArgs) { try { printAgentInfo(); /* * The jars that need to be added to the bootstrap classloader * are packaged in the /bootstrap directory inside the arex-agent.jar package. * These jars sh...
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
init
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
private static synchronized void installBootstrapJar(Instrumentation inst) throws Exception { File agentJarFile = getJarFile(ArexAgent.class); List<File> nestedBootStrapJars = JarUtils.extractNestedBootStrapJar(agentJarFile); for (File bootStrapFile : nestedBootStrapJars) { inst.appe...
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
installBootstrapJar
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
private static synchronized File getJarFile(Class<?> clazz) throws Exception { CodeSource codeSource = clazz.getProtectionDomain().getCodeSource(); if (codeSource == null) { throw new IllegalStateException("could not get agent jar location"); } return new File(codeSource.get...
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
getJarFile
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
public static void init(Instrumentation inst, File agent) { try { printAgentInfo(); /* * The jars that need to be added to the bootstrap classloader * are packaged in the /bootstrap directory inside the arex-agent.jar package. * These jars should be...
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
init
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
private static void printAgentInfo() { String agentVersion = ArexAgent.class.getPackage().getImplementationVersion(); System.out.printf("%s [AREX] Agent-v%s starts initialization...%n", getCurrentTime(), agentVersion); if (agentVersion != null) { System.setProperty(AGENT_VERSION, age...
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
printAgentInfo
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
private static String getCurrentTime() { return LocalDateTime.now().format(DATE_TIME_FORMATTER); }
Premain-Class for the Arex agent. <p>The JVM loads the class onto the application's classloader, and then the agent needs to append jars from its internal directory: bootstrap/ to the bootstrap classloader.
getCurrentTime
java
arextest/arex-agent-java
arex-agent/src/main/java/io/arex/agent/ArexAgent.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent/src/main/java/io/arex/agent/ArexAgent.java
Apache-2.0
public static void initialize(Instrumentation inst, File agentFile, String agentArgs, ClassLoader parentClassLoader) throws Exception { if (classLoader != null) { return; } initializeSimpleLoggerConfig(agentFile.getParent()); File[] extensionFiles = getExtensionJa...
@param parentClassLoader Normally, the parentClassLoader should be ClassLoaders.AppClassLoader.
initialize
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
Apache-2.0
private static void addJarToLoaderSearch(File agentFile, File[] extensionFiles) { AdviceClassesCollector.INSTANCE.addJarToLoaderSearch(agentFile); if (extensionFiles == null) { return; } for (File file : extensionFiles) { AdviceClassesCollector.INSTANCE.addJarTo...
@param parentClassLoader Normally, the parentClassLoader should be ClassLoaders.AppClassLoader.
addJarToLoaderSearch
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
Apache-2.0
private static File[] getExtensionJarFiles(File jarFile) { String extensionDir = jarFile.getParent() + "/extensions/"; return new File(extensionDir).listFiles(AgentInitializer::isJar); }
@param parentClassLoader Normally, the parentClassLoader should be ClassLoaders.AppClassLoader.
getExtensionJarFiles
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
Apache-2.0
private static boolean isJar(File f) { return f.isFile() && f.getName().endsWith(".jar"); }
@param parentClassLoader Normally, the parentClassLoader should be ClassLoaders.AppClassLoader.
isJar
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
Apache-2.0
private static AgentInstaller createAgentInstaller(Instrumentation inst, File file, String agentArgs) throws Exception { Class<?> clazz = classLoader.loadClass("io.arex.agent.instrumentation.InstrumentationInstaller"); Constructor<?> constructor = clazz.getDeclaredConstructor(Instrumentation.class, File...
@param parentClassLoader Normally, the parentClassLoader should be ClassLoaders.AppClassLoader.
createAgentInstaller
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
Apache-2.0
private static void initializeSimpleLoggerConfig(String agentFileParent) { System.setProperty(ConfigConstants.SIMPLE_LOGGER_SHOW_DATE_TIME, Boolean.TRUE.toString()); System.setProperty(ConfigConstants.SIMPLE_LOGGER_DATE_TIME_FORMAT, SIMPLE_DATE_FORMAT_MILLIS); String logPath = System.getPropert...
@param parentClassLoader Normally, the parentClassLoader should be ClassLoaders.AppClassLoader.
initializeSimpleLoggerConfig
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/AgentInitializer.java
Apache-2.0
public static String get(boolean createIfAbsent) { String messageId = TRACE_CONTEXT.get(); if (messageId == null && createIfAbsent) { messageId = idGenerator.next(); TRACE_CONTEXT.set(messageId); } return messageId; }
This method can only be called at the service entrance
get
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
Apache-2.0
public static String remove() { String messageId = TRACE_CONTEXT.get(); TRACE_CONTEXT.remove(); return messageId; }
This method can only be called at the service entrance
remove
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
Apache-2.0
public static String generateId() { return idGenerator.next(); }
This method can only be called at the service entrance
generateId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
Apache-2.0
public String next() { return PREFIX.concat(String.valueOf(getNowMillis())).concat(String.valueOf(COUNTER_UPDATER.getAndIncrement(this))); }
This method can only be called at the service entrance
next
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
Apache-2.0
private long getNowMillis() { return System.nanoTime() / 1000000; }
This method can only be called at the service entrance
getNowMillis
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/TraceContextManager.java
Apache-2.0
private static void wrapRunnableField(Runnable runnable) { try { Class<? extends Runnable> runnableClass = runnable.getClass(); Optional<Field> originalRunnableFieldOpt = COMPARABLE_RUNNABLE_FIELD_MAP.computeIfAbsent(runnableClass.getName(), k -> { for (Field declaredFiel...
issue: https://github.com/arextest/arex-agent-java/issues/516 executor with PriorityQueue ex: class PriorityRunnable extends Runnable implements Comparable<PriorityRunnable> { private final Runnable run; private final int priority; } can't wrap the PriorityRunnable because queue need runnable implement Comparab...
wrapRunnableField
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/ctx/RunnableWrapper.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/ctx/RunnableWrapper.java
Apache-2.0
public Map<String, String> getTags() { return this.tags; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getTags
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setTags(Map<String, String> tags) { this.tags = tags; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setTags
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public String getId() { return this.id; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public MockCategoryType getCategoryType() { return this.categoryType; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getCategoryType
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public String getReplayId() { return this.replayId; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getReplayId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public String getRecordId() { return this.recordId; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getRecordId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public String getAppId() { return this.appId; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getAppId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public int getRecordEnvironment() { return this.recordEnvironment; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getRecordEnvironment
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public String getRecordVersion() { return this.recordVersion; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getRecordVersion
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
@Deprecated public void setRecordVersion(String recordVersion) { this.recordVersion = recordVersion; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setRecordVersion
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public long getCreationTime() { return this.creationTime; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getCreationTime
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public Mocker.Target getTargetRequest() { return this.targetRequest; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getTargetRequest
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public Mocker.Target getTargetResponse() { return this.targetResponse; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getTargetResponse
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public String getOperationName() { return this.operationName; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getOperationName
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setId(String id) { this.id = id; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setCategoryType(MockCategoryType categoryType) { this.categoryType = categoryType; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setCategoryType
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setReplayId(String replayId) { this.replayId = replayId; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setReplayId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setRecordId(String recordId) { this.recordId = recordId; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setRecordId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setAppId(String appId) { this.appId = appId; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setAppId
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setRecordEnvironment(int recordEnvironment) { this.recordEnvironment = recordEnvironment; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setRecordEnvironment
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setCreationTime(long creationTime) { this.creationTime = creationTime; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setCreationTime
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setTargetRequest(Mocker.Target targetRequest) { this.targetRequest = targetRequest; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setTargetRequest
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setTargetResponse(Mocker.Target targetResponse) { this.targetResponse = targetResponse; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setTargetResponse
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setOperationName(String operationName) { this.operationName = operationName; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setOperationName
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public boolean isNeedMerge() { return needMerge; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
isNeedMerge
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setNeedMerge(boolean needMerge) { this.needMerge = needMerge; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setNeedMerge
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public boolean isMatched() { return matched.get(); }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
isMatched
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public void setMatched(boolean matched) { this.matched.compareAndSet(false, matched); }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setMatched
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
@Override public int getAccurateMatchKey() { return this.accurateMatchKey; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getAccurateMatchKey
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
@Override public void setAccurateMatchKey(int accurateMatchKey) { this.accurateMatchKey = accurateMatchKey; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setAccurateMatchKey
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
@Override public int getFuzzyMatchKey() { return this.fuzzyMatchKey; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
getFuzzyMatchKey
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
@Override public void setFuzzyMatchKey(int fuzzyMatchKey) { this.fuzzyMatchKey = fuzzyMatchKey; }
Put tag into the tags map will throw {@link UnsupportedOperationException}. @return the tags map
setFuzzyMatchKey
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ArexMocker.java
Apache-2.0
public static ComparableVersion of(String version) { if (StringUtil.isEmpty(version)) { return EMPTY; } final String[] split = StringUtil.split(version, SEPARATOR); List<Integer> list = new ArrayList<>(split.length); for (String s : split) { if (StringUtil...
supported format: number.number.number... 1.2.1 -> [1,2,1] 1.2.1-SNAPSHOT -> [1,2,1] 6.2.0.CR1 -> [6,2,0,1]
of
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ComparableVersion.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ComparableVersion.java
Apache-2.0
public List<Integer> getVersionItems() { return versionItems; }
supported format: number.number.number... 1.2.1 -> [1,2,1] 1.2.1-SNAPSHOT -> [1,2,1] 6.2.0.CR1 -> [6,2,0,1]
getVersionItems
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ComparableVersion.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ComparableVersion.java
Apache-2.0
@Override public int compareTo(ComparableVersion targetVersion) { if (targetVersion == null) { return 1; } Iterator<Integer> currentIterator = this.versionItems.iterator(); Iterator<Integer> targetIterator = targetVersion.getVersionItems().iterator(); while (curre...
supported format: number.number.number... 1.2.1 -> [1,2,1] 1.2.1-SNAPSHOT -> [1,2,1] 6.2.0.CR1 -> [6,2,0,1]
compareTo
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ComparableVersion.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ComparableVersion.java
Apache-2.0
public String getCode() { return code; }
Strict matching, Null if not matched
getCode
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/MockStrategyEnum.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/MockStrategyEnum.java
Apache-2.0
private void validateConstructorArguments() { TypeVariable<?>[] formals = rawType.getTypeParameters(); // check correct arity of actual type args if (formals.length != actualTypeArguments.length){ throw new MalformedParameterizedTypeException(); } for (int i = 0; i < ...
ref: <a href="https://github.com/openjdk/jdk17/blob/master/src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java"> sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java </a>
validateConstructorArguments
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
public static ParameterizedTypeImpl make(Class<?> rawType, Type[] actualTypeArguments, Type ownerType) { return new ParameterizedTypeImpl(rawType, actualTypeArguments, ownerType); }
Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw ...
make
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
public Type[] getActualTypeArguments() { return actualTypeArguments.clone(); }
Returns an array of <tt>Type</tt> objects representing the actual type arguments to this type. <p>Note that in some cases, the returned array be empty. This can occur if this type represents a non-parameterized type nested within a parameterized type. @return an array of <tt>Type</tt> objects representing the actual ...
getActualTypeArguments
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
public Class<?> getRawType() { return rawType; }
Returns the <tt>Type</tt> object representing the class or interface that declared this type. @return the <tt>Type</tt> object representing the class or interface that declared this type
getRawType
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
public Type getOwnerType() { return ownerType; }
Returns a <tt>Type</tt> object representing the type that this type is a member of. For example, if this type is <tt>O<T>.I<S></tt>, return a representation of <tt>O<T></tt>. <p>If this type is a top-level type, <tt>null</tt> is returned. @return a <tt>Type</tt> object representing the type that this type is a m...
getOwnerType
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
@Override public boolean equals(Object o) { if (o instanceof ParameterizedType) { // Check that information is equivalent ParameterizedType that = (ParameterizedType) o; if (this == that) return true; Type thatOwner = that.getOwnerType(); ...
Returns a <tt>Type</tt> object representing the type that this type is a member of. For example, if this type is <tt>O<T>.I<S></tt>, return a representation of <tt>O<T></tt>. <p>If this type is a top-level type, <tt>null</tt> is returned. @return a <tt>Type</tt> object representing the type that this type is a m...
equals
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
@Override public int hashCode() { return Arrays.hashCode(actualTypeArguments) ^ Objects.hashCode(ownerType) ^ Objects.hashCode(rawType); }
Returns a <tt>Type</tt> object representing the type that this type is a member of. For example, if this type is <tt>O<T>.I<S></tt>, return a representation of <tt>O<T></tt>. <p>If this type is a top-level type, <tt>null</tt> is returned. @return a <tt>Type</tt> object representing the type that this type is a m...
hashCode
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
public String toString() { StringBuilder sb = new StringBuilder(); if (ownerType != null) { if (ownerType instanceof Class) sb.append(((Class)ownerType).getName()); else sb.append(ownerType.toString()); sb.append("$"); if...
Returns a <tt>Type</tt> object representing the type that this type is a member of. For example, if this type is <tt>O<T>.I<S></tt>, return a representation of <tt>O<T></tt>. <p>If this type is a top-level type, <tt>null</tt> is returned. @return a <tt>Type</tt> object representing the type that this type is a m...
toString
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/model/ParameterizedTypeImpl.java
Apache-2.0
public static boolean isEmpty(Collection<?> coll) { return (coll == null || coll.isEmpty()); }
Suppresses default constructor, ensuring non-instantiability.
isEmpty
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
public static boolean isNotEmpty(Collection<?> coll) { return !isEmpty(coll); }
Suppresses default constructor, ensuring non-instantiability.
isNotEmpty
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
@SuppressWarnings("unchecked") public static <E> List<E> emptyList() { return (List<E>) EMPTY_LIST; }
Suppresses default constructor, ensuring non-instantiability.
emptyList
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
public static <E> List<E> newArrayList() { return new ArrayList<>(); }
Suppresses default constructor, ensuring non-instantiability.
newArrayList
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
@SafeVarargs public static <E> List<E> newArrayList(E... elements) { if (elements == null) { return emptyList(); } List<E> list = new ArrayList<>(elements.length); Collections.addAll(list, elements); return list; }
Suppresses default constructor, ensuring non-instantiability.
newArrayList
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
@SafeVarargs public static <E> Set<E> newHashSet(E... elements) { if (elements == null) { return new HashSet<>(); } Set<E> set = new HashSet<>(elements.length); Collections.addAll(set, elements); return set; }
Suppresses default constructor, ensuring non-instantiability.
newHashSet
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
public static <V> List<List<V>> split(List<V> originalList, int splitCount) { if (isEmpty(originalList)) { return emptyList(); } int originalSize = originalList.size(); List<List<V>> splitList = new ArrayList<>(); if (originalSize < splitCount || splitCount == 0) { ...
split to multiple list by split count
split
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
public static <V> List<V> filterNull(List<V> originalList) { if (isEmpty(originalList)) { return emptyList(); } List<V> filterList = new ArrayList<>(originalList.size()); for (V element : originalList) { if (element != null) { filterList.add(elemen...
split to multiple list by split count
filterNull
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
public static byte[] listToByteArray(List<byte[]> list) { int totalLength = 0; for (byte[] array : list) { totalLength += array.length; } byte[] result = new byte[totalLength]; int currentPos = 0; for (byte[] array : list) { System.arraycopy(arra...
split to multiple list by split count
listToByteArray
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/CollectionUtil.java
Apache-2.0
public static void cleanDirectory(File directory) throws IOException { if (!directory.exists()) { String message = directory + " does not exist"; throw new IllegalArgumentException(message); } if (!directory.isDirectory()) { String message = directory + " is ...
Cleans a directory without deleting it. @param directory directory to clean @throws IOException in case cleaning is unsuccessful
cleanDirectory
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/FileUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/FileUtils.java
Apache-2.0
public static void forceDelete(File file) throws IOException { if (file.isDirectory()) { deleteDirectory(file); } else { boolean filePresent = file.exists(); if (!file.delete()) { if (!filePresent){ throw new FileNotFoundException("...
Deletes a file. If file is a directory, delete it and all sub-directories. <p> The difference between File.delete() and this method are: <ul> <li>A directory to be deleted does not have to be empty.</li> <li>You get exceptions when a file or directory cannot be deleted. (java.io.File methods returns a boolean)</li...
forceDelete
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/FileUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/FileUtils.java
Apache-2.0
public static void deleteDirectory(File directory) throws IOException { if (!directory.exists()) { return; } cleanDirectory(directory); if (!directory.delete()) { String message = "Unable to delete directory " + directory + "."; t...
Deletes a directory recursively. @param directory directory to delete @throws IOException in case deletion is unsuccessful
deleteDirectory
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/FileUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/FileUtils.java
Apache-2.0
public static void appendToClassLoaderSearch(ClassLoader classLoader, File jarFile) { try { if (classLoader instanceof URLClassLoader) { addURL.invoke(classLoader, jarFile.toURI().toURL()); } /* * Due to Java 8 vs java 9+ incompatibility issues ...
tomcat jdk <= 8, classLoader is ParallelWebappClassLoader, ClassLoader.getSystemClassLoader() is Launcher$AppClassLoader jdk > 8, classLoader is ParallelWebappClassLoader, ClassLoader.getSystemClassLoader() is ClassLoaders$AppClassLoader
appendToClassLoaderSearch
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/JarUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/JarUtils.java
Apache-2.0
private static void appendToAppClassLoaderSearch(ClassLoader classLoader, File jarFile) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Class<? extends ClassLoader> loaderClass = classLoader.getClass(); if (JdkUtils.isJdk11OrHigher() && ConfigConstants.APP_CLASSLOADER_N...
append jar jdk.internal.loader.ClassLoaders.AppClassLoader if java version >= 11 need add jvm option:--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED
appendToAppClassLoaderSearch
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/JarUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/JarUtils.java
Apache-2.0
public static boolean isEmpty(Map<?, ?> map) { return map == null || map.isEmpty(); }
The largest power of two that can be represented as an {@code int}. @since 10.0
isEmpty
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
Apache-2.0
public static boolean isNotEmpty(Map<?, ?> map) { return !isEmpty(map); }
The largest power of two that can be represented as an {@code int}. @since 10.0
isNotEmpty
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
Apache-2.0
public static <K, V> Map<K, V> newHashMapWithExpectedSize(int expectedSize) { return new HashMap<>(capacity(expectedSize)); }
The largest power of two that can be represented as an {@code int}. @since 10.0
newHashMapWithExpectedSize
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
Apache-2.0
static int capacity(int expectedSize) { if (expectedSize < 3) { return expectedSize + 1; } if (expectedSize < MAX_POWER_OF_TWO) { // This is the calculation used in JDK8 to resize when a putAll // happens; it seems to be the most conservative calculation we ...
The largest power of two that can be represented as an {@code int}. @since 10.0
capacity
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
Apache-2.0
public static <K> boolean getBoolean(final Map<? super K, ?> map, final K key) { return getBoolean(map, key, false); }
The largest power of two that can be represented as an {@code int}. @since 10.0
getBoolean
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
Apache-2.0
public static <K> boolean getBoolean(final Map<? super K, ?> map, final K key, boolean defaultValue) { if (isEmpty(map) || map.get(key) == null) { return defaultValue; } final Object answer = map.get(key); if (answer instanceof Boolean) { return (Boolean) answer; ...
The largest power of two that can be represented as an {@code int}. @since 10.0
getBoolean
java
arextest/arex-agent-java
arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
https://github.com/arextest/arex-agent-java/blob/master/arex-agent-bootstrap/src/main/java/io/arex/agent/bootstrap/util/MapUtils.java
Apache-2.0