id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
18871700_107
{ "fields": [ { "declarator": "offset = SQLTestsConstants.offset", "modifier": "private static final", "original_string": "private static final int offset = SQLTestsConstants.offset;", "type": "int", "var_name": "offset" }, { "declarator": "connectionPool", "modif...
{ "body": "@Test\n public void getContainerProperty_freeformExistingItemIdAndPropertyId_returnsProperty()\n throws SQLException {\n SQLContainer container = new SQLContainer(new FreeformQuery(\n \"SELECT * FROM people\", connectionPool, \"ID\"));\n if (SQLTestsConstants.db =...
{ "fields": [ { "declarator": "queryDelegate", "modifier": "private", "original_string": "private QueryDelegate queryDelegate;", "type": "QueryDelegate", "var_name": "queryDelegate" }, { "declarator": "autoCommit = false", "modifier": "private", "original_st...
{ "body": "@Override\n public Property getContainerProperty(Object itemId, Object propertyId) {\n Item item = getItem(itemId);\n if (item == null) {\n return null;\n }\n return item.getItemProperty(propertyId);\n }", "class_method_signature": "SQLContainer.getContainerPr...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_150
{ "fields": [ { "declarator": "ID1 = \"id1\"", "modifier": "private static final", "original_string": "private static final String ID1 = \"id1\";", "type": "String", "var_name": "ID1" }, { "declarator": "ID2 = \"id2\"", "modifier": "private static final", "o...
{ "body": "@Test\n public void testRemoveNonExistentListener() {\n PropertysetItem item = createPropertySetItem();\n item.removePropertySetChangeListener(propertySetListenerMock);\n }", "class_method_signature": "PropertySetItemTest.testRemoveNonExistentListener()", "constructor": false, "fu...
{ "fields": [ { "declarator": "map = new HashMap<Object, Property<?>>()", "modifier": "private", "original_string": "private HashMap<Object, Property<?>> map = new HashMap<Object, Property<?>>();", "type": "HashMap<Object, Property<?>>", "var_name": "map" }, { "declarat...
{ "body": "@Override\n public void removePropertySetChangeListener(\n Item.PropertySetChangeListener listener) {\n if (propertySetChangeListeners != null) {\n propertySetChangeListeners.remove(listener);\n }\n }", "class_method_signature": "PropertysetItem.removePropertySet...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_146
{ "fields": [], "file": "server/src/test/java/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java", "identifier": "ColumnPropertyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void writableButReadOnlyColumnsShouldNotBeInValueMap_shouldReturnFalse() {\n ColumnProperty property = new ColumnProperty(\"NAME\", true, true, true,\n false, \"Ville\", String.class);\n\n Assert.assertFalse(property.isPersistent());\n }", "class_method_s...
{ "fields": [ { "declarator": "serialVersionUID = -3694463129581802457L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -3694463129581802457L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "own...
{ "body": "public boolean isPersistent() {\n if (isVersionColumn()) {\n return false;\n } else if (isReadOnlyChangeAllowed() && !isReadOnly()) {\n return true;\n } else {\n return false;\n }\n }", "class_method_signature": "ColumnProperty.isPersistent(...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_111
{ "fields": [ { "declarator": "offset = SQLTestsConstants.offset", "modifier": "private static final", "original_string": "private static final int offset = SQLTestsConstants.offset;", "type": "int", "var_name": "offset" }, { "declarator": "connectionPool", "modif...
{ "body": "@Test\n public void getItem_freeform5000RowsWithParameter1337_returnsItemWithId1337()\n throws SQLException {\n DataGenerator.addFiveThousandPeople(connectionPool);\n SQLContainer container = new SQLContainer(new FreeformQuery(\n \"SELECT * FROM people\", connecti...
{ "fields": [ { "declarator": "queryDelegate", "modifier": "private", "original_string": "private QueryDelegate queryDelegate;", "type": "QueryDelegate", "var_name": "queryDelegate" }, { "declarator": "autoCommit = false", "modifier": "private", "original_st...
{ "body": "@Override\n public Item getItem(Object itemId) {\n if (!cachedItems.containsKey(itemId)) {\n int index = indexOfId(itemId);\n if (index >= size) {\n // The index is in the added items\n int offset = index - size;\n RowItem item = ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_189
{ "fields": [ { "declarator": "request", "modifier": "private", "original_string": "private PortletRequest request;", "type": "PortletRequest", "var_name": "request" }, { "declarator": "sut", "modifier": "private", "original_string": "private VaadinPortletRe...
{ "body": "@Test\n public void defaultValueForPortletPreferenceIsNull() {\n when(preferences.getValue(anyString(), isNull(String.class)))\n .thenReturn(null);\n\n String value = sut.getPortletPreference(\"foo\");\n\n assertNull(value);\n }", "class_method_signature": "Vaadi...
{ "fields": [ { "declarator": "vaadinService", "modifier": "private final", "original_string": "private final VaadinPortletService vaadinService;", "type": "VaadinPortletService", "var_name": "vaadinService" } ], "file": "server/src/main/java/com/vaadin/server/VaadinPortletRe...
{ "body": "public String getPortletPreference(String name) {\n PortletRequest request = getRequest();\n PortletPreferences preferences = request.getPreferences();\n\n return preferences.getValue(name, null);\n }", "class_method_signature": "VaadinPortletRequest.getPortletPreference(String na...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_166
{ "fields": [], "file": "server/src/test/java/com/vaadin/ui/TextAreaTest.java", "identifier": "TextAreaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void emptyAfterClear() {\n TextArea tf = new TextArea();\n tf.setValue(\"foobar\");\n Assert.assertFalse(tf.isEmpty());\n tf.clear();\n Assert.assertTrue(tf.isEmpty());\n }", "class_method_signature": "TextAreaTest.emptyAfterClear()", "constructor...
{ "fields": [], "file": "server/src/main/java/com/vaadin/ui/TextArea.java", "identifier": "TextArea", "interfaces": "", "methods": [ { "class_method_signature": "TextArea.TextArea()", "constructor": true, "full_signature": "public TextArea()", "identifier": "TextArea", "modi...
{ "body": "@Override\n public void clear() {\n setValue(\"\");\n }", "class_method_signature": "TextArea.clear()", "constructor": false, "full_signature": "@Override public void clear()", "identifier": "clear", "invocations": [ "setValue" ], "modifiers": "@Override public", "parameter...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_131
{ "fields": [ { "declarator": "offset = SQLTestsConstants.offset", "modifier": "private static final", "original_string": "private static final int offset = SQLTestsConstants.offset;", "type": "int", "var_name": "offset" }, { "declarator": "connectionPool", "modif...
{ "body": "@Test(expected = UnsupportedOperationException.class)\n public void addItemAfterObjectObject_normal_isUnsupported()\n throws SQLException {\n SQLContainer container = new SQLContainer(new FreeformQuery(\n \"SELECT * FROM people\", connectionPool, \"ID\"));\n conta...
{ "fields": [ { "declarator": "queryDelegate", "modifier": "private", "original_string": "private QueryDelegate queryDelegate;", "type": "QueryDelegate", "var_name": "queryDelegate" }, { "declarator": "autoCommit = false", "modifier": "private", "original_st...
{ "body": "@Override\n public Item addItemAfter(Object previousItemId, Object newItemId)\n throws UnsupportedOperationException {\n throw new UnsupportedOperationException();\n }", "class_method_signature": "SQLContainer.addItemAfter(Object previousItemId, Object newItemId)", "constructor"...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_92
{ "fields": [ { "declarator": "offset = SQLTestsConstants.offset", "modifier": "private static final", "original_string": "private static final int offset = SQLTestsConstants.offset;", "type": "int", "var_name": "offset" }, { "declarator": "connectionPool", "modif...
{ "body": "@Test\n public void containsRowWithKeys_simpleQueryWithInvalidKeys_shouldFail()\n throws SQLException {\n FreeformQuery query = new FreeformQuery(\"SELECT * FROM people\",\n Arrays.asList(\"ID\"), connectionPool);\n Assert.assertFalse(query.containsRowWithKey(3879...
{ "fields": [ { "declarator": "delegate = null", "modifier": "", "original_string": "FreeformQueryDelegate delegate = null;", "type": "FreeformQueryDelegate", "var_name": "delegate" }, { "declarator": "queryString", "modifier": "private", "original_string": ...
{ "body": "@Override\n @SuppressWarnings(\"deprecation\")\n public boolean containsRowWithKey(Object... keys) throws SQLException {\n String query = null;\n boolean contains = false;\n if (delegate != null) {\n if (delegate instanceof FreeformStatementDelegate) {\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_84
{ "fields": [ { "declarator": "offset = SQLTestsConstants.offset", "modifier": "private static final", "original_string": "private static final int offset = SQLTestsConstants.offset;", "type": "int", "var_name": "offset" }, { "declarator": "connectionPool", "modif...
{ "body": "@Test\n public void getCount_normalState_releasesConnection() throws SQLException {\n FreeformQuery query = new FreeformQuery(\n \"SELECT * FROM people WHERE \\\"NAME\\\" LIKE '%lle'\",\n connectionPool, \"ID\");\n query.getCount();\n query.getCount();\...
{ "fields": [ { "declarator": "delegate = null", "modifier": "", "original_string": "FreeformQueryDelegate delegate = null;", "type": "FreeformQueryDelegate", "var_name": "delegate" }, { "declarator": "queryString", "modifier": "private", "original_string": ...
{ "body": "@Override\n public int getCount() throws SQLException {\n // First try the delegate\n int count = countByDelegate();\n if (count < 0) {\n // Couldn't use the delegate, use the bad way.\n Statement statement = null;\n ResultSet rs = null;\n ...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_127
{ "fields": [ { "declarator": "offset = SQLTestsConstants.offset", "modifier": "private static final", "original_string": "private static final int offset = SQLTestsConstants.offset;", "type": "int", "var_name": "offset" }, { "declarator": "connectionPool", "modif...
{ "body": "@Test\n public void getPageLength_freeform_returnsDefault100() throws SQLException {\n SQLContainer container = new SQLContainer(new FreeformQuery(\n \"SELECT * FROM people\", connectionPool, \"ID\"));\n Assert.assertEquals(100, container.getPageLength());\n }", "class_...
{ "fields": [ { "declarator": "queryDelegate", "modifier": "private", "original_string": "private QueryDelegate queryDelegate;", "type": "QueryDelegate", "var_name": "queryDelegate" }, { "declarator": "autoCommit = false", "modifier": "private", "original_st...
{ "body": "public int getPageLength() {\n return pageLength;\n }", "class_method_signature": "SQLContainer.getPageLength()", "constructor": false, "full_signature": "public int getPageLength()", "identifier": "getPageLength", "invocations": [], "modifiers": "public", "parameters": "()", "ret...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_170
{ "fields": [], "file": "server/src/test/java/com/vaadin/server/AbstractClientConnectorTest.java", "identifier": "AbstractClientConnectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void registerRPCInterfaceTest() {\n AbstractClientConnector mock = mock(AbstractClientConnector.class);\n ServerRpcMock implementation = new ServerRpcMock();\n Mockito.doCallRealMethod().when(mock).registerRpc(implementation);\n mock.registerRpc(implementation)...
{ "fields": [ { "declarator": "rpcManagerMap = new HashMap<String, ServerRpcManager<?>>()", "modifier": "private", "original_string": "private Map<String, ServerRpcManager<?>> rpcManagerMap = new HashMap<String, ServerRpcManager<?>>();", "type": "Map<String, ServerRpcManager<?>>", "v...
{ "body": "protected <T extends ServerRpc> void registerRpc(T implementation,\n Class<T> rpcInterfaceType) {\n rpcManagerMap.put(rpcInterfaceType.getName(), new ServerRpcManager<T>(\n implementation, rpcInterfaceType));\n }", "class_method_signature": "AbstractClientConnector.reg...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_47
{ "fields": [], "file": "server/src/test/java/com/vaadin/data/util/IndexedContainerTest.java", "identifier": "IndexedContainerTest", "interfaces": "", "superclass": "extends AbstractInMemoryContainerTestBase" }
{ "body": "@Test(expected = IndexOutOfBoundsException.class)\n public void testGetItemIdsRangeIndexOutOfBounds2() {\n IndexedContainer ic = new IndexedContainer();\n ic.addItem(new Object());\n ic.getItemIds(2, 1);\n }", "class_method_signature": "IndexedContainerTest.testGetItemIdsRangeI...
{ "fields": [ { "declarator": "propertyIds = new ArrayList<Object>()", "modifier": "private", "original_string": "private ArrayList<Object> propertyIds = new ArrayList<Object>();", "type": "ArrayList<Object>", "var_name": "propertyIds" }, { "declarator": "types = new Ha...
{ "body": "@Override\n public Object addItem() {\n\n // Creates a new id\n final Object id = generateId();\n\n // Adds the Item into container\n addItem(id);\n\n return id;\n }", "class_method_signature": "IndexedContainer.addItem()", "constructor": false, "full_signatur...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_10
{ "fields": [], "file": "shared/src/test/java/com/vaadin/shared/ui/grid/RangeTest.java", "identifier": "RangeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void startAfterEndTest() {\n Range.between(10, 9);\n }", "class_method_signature": "RangeTest.startAfterEndTest()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class) public void startAfterEn...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final int start;", "type": "int", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final int end;", "t...
{ "body": "public static Range between(final int start, final int end)\n throws IllegalArgumentException {\n return new Range(start, end);\n }", "class_method_signature": "Range.between(final int start, final int end)", "constructor": false, "full_signature": "public static Range between(fi...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
18871700_51
{ "fields": [], "file": "server/src/test/java/com/vaadin/data/util/IndexedContainerTest.java", "identifier": "IndexedContainerTest", "interfaces": "", "superclass": "extends AbstractInMemoryContainerTestBase" }
{ "body": "@Test\n public void testGetItemIdsRangeBaseCase() {\n IndexedContainer ic = new IndexedContainer();\n String object1 = new String(\"Obj1\");\n String object2 = new String(\"Obj2\");\n String object3 = new String(\"Obj3\");\n String object4 = new String(\"Obj4\");\n ...
{ "fields": [ { "declarator": "propertyIds = new ArrayList<Object>()", "modifier": "private", "original_string": "private ArrayList<Object> propertyIds = new ArrayList<Object>();", "type": "ArrayList<Object>", "var_name": "propertyIds" }, { "declarator": "types = new Ha...
{ "body": "@Override\n public Object addItem() {\n\n // Creates a new id\n final Object id = generateId();\n\n // Adds the Item into container\n addItem(id);\n\n return id;\n }", "class_method_signature": "IndexedContainer.addItem()", "constructor": false, "full_signatur...
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 18871700, "size": 95570, "stargazer_count": 5, "stars": null, "updates": null, "url": "https://github.com/jdahlstrom/vaadin.react" }
119475284_38
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void int2Bin() {\n assertEquals(\"111_1111_1111_1111_1111_1111_1111_1111\".replace(\"_\", \"\"), BitUtil.int2Bin(2147483647));\n }", "class_method_signature": "BitUtilTest.int2Bin()", "constructor": false, "full_signature": "@Test public void int2Bin()", "identifier": "i...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static String int2Bin(int source) {\n return Integer.toBinaryString(source);\n }", "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "identifier": "int2Bin", "invocations": [ "toBinaryS...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_14
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void SHA224() {\n assertEquals(\"917ecca24f3e6ceaf52375d8083381f1f80a21e6e49fbadc40afeb8e\", TextUtil.SHA224(\"TEST\"));\n }", "class_method_signature": "TextUtilTest.SHA224()", "constructor": false, "full_signature": "@Test public void SHA224()", "identifier": "SHA224",...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String SHA224(String content) {\n return bytes2Hex(digest(content.getBytes(), \"SHA-224\"));\n }", "class_method_signature": "TextUtil.SHA224(String content)", "constructor": false, "full_signature": "public static String SHA224(String content)", "identifier": "SHA224", "i...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_43
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void setIntBit() {\n assertEquals(\"1011\", BitUtil.int2Bin(BitUtil.setIntBit(BitUtil.bin2Int(\"1011\"), 2, true)));\n assertEquals(\"1011\", BitUtil.int2Bin(BitUtil.setIntBit(BitUtil.bin2Int(\"1001\"), 2, true)));\n assertEquals(\"1001\", BitUtil.int2Bin(BitUtil.setI...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static int setIntBit(int source, int pos, boolean value) {\n if (getIntBit(source, pos) == value) return source;\n pos = pos - 1;\n int bitValue = 1 << pos;\n if (value) {\n return source | bitValue;\n } else {\n return source ^ bitValue;\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_55
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isInteger() {\n assertTrue(RegexUtil.isInteger(\"64646416846\", Long.MIN_VALUE, Long.MAX_VALUE));\n }", "class_method_signature": "RegexUtilTest.isInteger()", "constructor": false, "full_signature": "@Test public void isInteger()", "identifier": "isInteger", "invo...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isInteger(String integer, long min, long max) {\n if (integer == null) return false;\n if (!integer.matches(\"^-?[0-9](\\\\d)*$\")) return false;\n long num;\n try {\n num = Long.valueOf(integer);\n } catch (NumberFormatException e) {\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_22
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hmacSHA256() {\n assertEquals(\"615dac1c53c9396d8f69a419a0b2d9393a0461d7ad5f7f3d9beb57264129ef12\", TextUtil.HmacSHA256(\"TEST\", \"KEY\"));\n }", "class_method_signature": "TextUtilTest.hmacSHA256()", "constructor": false, "full_signature": "@Test public void hmacSHA...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String HmacSHA256(String content, String key) {\n return bytes2Hex(Hmac(content.getBytes(), \"HmacSHA256\", key.getBytes()));\n }", "class_method_signature": "TextUtil.HmacSHA256(String content, String key)", "constructor": false, "full_signature": "public static String HmacSH...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_0
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void int2BytesBigEndian() {\n assertArrayEquals(new byte[]{0, 0, (byte) 0x12, (byte) 0x34}, ByteUtil.int2BytesBigEndian(0x1234));\n assertArrayEquals(new byte[]{(byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78}, ByteUtil.int2BytesBigEndian(0x12345678));\n }", "class_m...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static byte[] int2BytesBigEndian(int i) {\n byte[] bytes = new byte[4];\n bytes[0] = (byte) ((i >> 24) & 0xff);\n bytes[1] = (byte) ((i >> 16) & 0xff);\n bytes[2] = (byte) ((i >> 8) & 0xff);\n bytes[3] = (byte) (i & 0xff);\n return bytes;\n }", "class_m...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_34
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bytes2Hex() {\n assertEquals(\"54455354\", TextUtil.bytes2Hex(\"TEST\".getBytes()));\n assertEquals(\"54455354\", TextUtil.bytes2Hex(\"TEST\".getBytes(), false));\n assertEquals(\"54 45 53 54\", TextUtil.bytes2Hex(\"TEST\".getBytes(), true));\n }", "class_me...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String bytes2Hex(byte... bytes) {\n return bytes2Hex(bytes, false);\n }", "class_method_signature": "TextUtil.bytes2Hex(byte... bytes)", "constructor": false, "full_signature": "public static String bytes2Hex(byte... bytes)", "identifier": "bytes2Hex", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_18
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void digest() {\n }", "class_method_signature": "TextUtilTest.digest()", "constructor": false, "full_signature": "@Test public void digest()", "identifier": "digest", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "v...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static byte[] digest(byte[] data, String algorithm) {\n if (data == null || data.length == 0) throw new NullPointerException();\n try {\n MessageDigest messageDigest = MessageDigest.getInstance(algorithm);\n messageDigest.update(data);\n return messageD...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_59
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isIp4Address() {\n assertTrue(RegexUtil.isIp4Address(\"0.0.0.0\"));\n assertTrue(RegexUtil.isIp4Address(\"192.168.1.255\"));\n }", "class_method_signature": "RegexUtilTest.isIp4Address()", "constructor": false, "full_signature": "@Test public void isIp4Address(...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isIp4Address(String address) {\n if (address == null) return false;\n return address.matches(\"^((25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d?)\\\\.){3}(25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d?)$\");\n }", "class_method_signature": "RegexUtil.isIp4Address(String address)", "c...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_58
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isIpAddress() {\n assertTrue(RegexUtil.isIpAddress(\"0.0.0.0\"));\n assertTrue(RegexUtil.isIpAddress(\"192.168.1.255\"));\n assertTrue(RegexUtil.isIpAddress(\"fe80:0:0:0:20c:29ff:fe6b:2516\"));\n assertTrue(RegexUtil.isIpAddress(\"1040::1\"));\n }", "...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isIpAddress(String address) {\n if (address == null) return false;\n return isIp4Address(address) || isIp6Address(address);\n }", "class_method_signature": "RegexUtil.isIpAddress(String address)", "constructor": false, "full_signature": "public static boolean is...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_19
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hmacMD5() {\n assertEquals(\"1aee732e9c1d3faa20775d1438af9472\", TextUtil.HmacMD5(\"TEST\", \"KEY\"));\n }", "class_method_signature": "TextUtilTest.hmacMD5()", "constructor": false, "full_signature": "@Test public void hmacMD5()", "identifier": "hmacMD5", "invoca...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String HmacMD5(String content, String key) {\n return bytes2Hex(Hmac(content.getBytes(), \"HmacMD5\", key.getBytes()));\n }", "class_method_signature": "TextUtil.HmacMD5(String content, String key)", "constructor": false, "full_signature": "public static String HmacMD5(String ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_35
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hex2Bytes() {\n assertEquals(\"TEST\", new String(TextUtil.hex2Bytes(\"54455354\")));\n assertEquals(\"TEST\", new String(TextUtil.hex2Bytes(\"54 45 53 54\")));\n }", "class_method_signature": "TextUtilTest.hex2Bytes()", "constructor": false, "full_signature": ...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static byte[] hex2Bytes(String inHex) {\n if (inHex == null) return new byte[0];\n inHex = inHex.replace(\" \", \"\");\n int hexlen = inHex.length();\n if (hexlen % 2 == 1) {\n // 奇数个字符高位补0\n hexlen++;\n inHex = \"0\" + inHex;\n }\n...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_23
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hmacSHA384() {\n assertEquals(\"03ae3f1ba7a6626b24de55db51dbaa498c2baaa58b4a2617f48c8f7eae58a31e70f2d9f82241e1bbb287d89902f2fe3a\", TextUtil.HmacSHA384(\"TEST\", \"KEY\"));\n }", "class_method_signature": "TextUtilTest.hmacSHA384()", "constructor": false, "full_signat...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String HmacSHA384(String content, String key) {\n return bytes2Hex(Hmac(content.getBytes(), \"HmacSHA384\", key.getBytes()));\n }", "class_method_signature": "TextUtil.HmacSHA384(String content, String key)", "constructor": false, "full_signature": "public static String HmacSH...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_1
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bytes2IntBigEndian() {\n assertEquals(0x1234, ByteUtil.bytes2IntBigEndian((byte) 0x12, (byte) 0x34));\n assertEquals(0x12345678, ByteUtil.bytes2IntBigEndian((byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78));\n }", "class_method_signature": "ByteUtilTest.bytes2In...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static int bytes2IntBigEndian(byte... bytes) {\n int result = 0;\n if (bytes == null || bytes.length == 0) return result;\n result |= (bytes[0] & 0xff);\n for (int i = 1; i < bytes.length; i++) {\n result = result << 8;\n result |= (bytes[i] & 0xff);...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_54
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isLowerMoney() {\n assertTrue(RegexUtil.isLowerMoney(\"1234567890.73\"));\n assertFalse(RegexUtil.isLowerMoney(\"-1234567890.73\"));\n }", "class_method_signature": "RegexUtilTest.isLowerMoney()", "constructor": false, "full_signature": "@Test public void isLow...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isLowerMoney(String money) {\n if (money == null) return false;\n money = money.replace(\",\", \"\");\n return money.matches(\"^\\\\d+\\\\.?\\\\d{0,2}$\");\n }", "class_method_signature": "RegexUtil.isLowerMoney(String money)", "constructor": false, "full...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_42
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getIntBit() {\n assertTrue(BitUtil.getIntBit(4, 3));\n assertFalse(BitUtil.getIntBit(4, 2));\n }", "class_method_signature": "BitUtilTest.getIntBit()", "constructor": false, "full_signature": "@Test public void getIntBit()", "identifier": "getIntBit", "invo...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static boolean getIntBit(int source, int pos) {\n pos = pos - 1;\n int bitValue = 1 << pos;\n return (source & bitValue) == bitValue;\n }", "class_method_signature": "BitUtil.getIntBit(int source, int pos)", "constructor": false, "full_signature": "public static boolean...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_15
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void SHA256() {\n assertEquals(\"94ee059335e587e501cc4bf90613e0814f00a7b08bc7c648fd865a2af6a22cc2\", TextUtil.SHA256(\"TEST\"));\n }", "class_method_signature": "TextUtilTest.SHA256()", "constructor": false, "full_signature": "@Test public void SHA256()", "identifier": "...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String SHA256(String content) {\n return bytes2Hex(digest(content.getBytes(), \"SHA-256\"));\n }", "class_method_signature": "TextUtil.SHA256(String content)", "constructor": false, "full_signature": "public static String SHA256(String content)", "identifier": "SHA256", "i...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_39
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bin2Int() {\n assertEquals(2147483647, BitUtil.bin2Int(\"111_1111_1111_1111_1111_1111_1111_1111\".replace(\"_\", \"\")));\n assertEquals(2147483647, BitUtil.bin2Int(\"0b111_1111_1111_1111_1111_1111_1111_1111\".replace(\"_\", \"\")));\n }", "class_method_signature":...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static int bin2Int(String source) {\n if (source.startsWith(\"0b\")) source = source.substring(2);\n return Integer.parseInt(source, 2);\n }", "class_method_signature": "BitUtil.bin2Int(String source)", "constructor": false, "full_signature": "public static int bin2Int(String ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_6
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void long2BytesLittleEndian() {\n assertArrayEquals(new byte[]{(byte) 0x34, (byte) 0x12, 0, 0, 0, 0, 0, 0}, ByteUtil.long2BytesLittleEndian(0x1234L));\n assertArrayEquals(new byte[]{(byte) 0xAB, (byte) 0x90, (byte) 0x78, (byte) 0x56, (byte) 0x34, (byte) 0x12, 0, 0}, ByteUtil...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static byte[] long2BytesLittleEndian(long l) {\n byte[] bytes = new byte[8];\n bytes[0] = (byte) (l & 0xFF);\n bytes[1] = (byte) (l >> 8 & 0xFF);\n bytes[2] = (byte) (l >> 16 & 0xFF);\n bytes[3] = (byte) (l >> 24 & 0xFF);\n bytes[4] = (byte) (l >> 32 & 0xFF)...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_24
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hmacSHA512() {\n assertEquals(\"c0fcb3918e49a7f5af5af7881b9b89951efa39ae1f276237f483d19e0dbc504aaf6febe7e3af4a1dd3bd06ba9de8737b61b903b584d50b78a549a65fa0806100\", TextUtil.HmacSHA512(\"TEST\", \"KEY\"));\n }", "class_method_signature": "TextUtilTest.hmacSHA512()", "con...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String HmacSHA512(String content, String key) {\n return bytes2Hex(Hmac(content.getBytes(), \"HmacSHA512\", key.getBytes()));\n }", "class_method_signature": "TextUtil.HmacSHA512(String content, String key)", "constructor": false, "full_signature": "public static String HmacSH...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_32
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void money2ChineseTraditional() {\n assertEquals(\"壹亿零贰佰肆拾万零玖拾元整\", TextUtil.money2ChineseTraditional(102400090));\n }", "class_method_signature": "TextUtilTest.money2ChineseTraditional()", "constructor": false, "full_signature": "@Test public void money2ChineseTraditional...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String money2ChineseTraditional(double money) {\n return number2Traditional(\n money2Chinese(money)\n );\n }", "class_method_signature": "TextUtil.money2ChineseTraditional(double money)", "constructor": false, "full_signature": "public static String money...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_49
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isAuthCode() {\n assertTrue(RegexUtil.isAuthCode(\"001235\"));\n assertTrue(RegexUtil.isAuthCode(\"1232\", 4, 8));\n }", "class_method_signature": "RegexUtilTest.isAuthCode()", "constructor": false, "full_signature": "@Test public void isAuthCode()", "identif...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isAuthCode(String num) {\n return isAuthCode(num, 4, 8);\n }", "class_method_signature": "RegexUtil.isAuthCode(String num)", "constructor": false, "full_signature": "public static boolean isAuthCode(String num)", "identifier": "isAuthCode", "invocations": [ "is...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_28
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void string2Unicode() {\n assertEquals(\"\\\\u0054\\\\u0045\\\\u0053\\\\u0054\", TextUtil.string2Unicode(\"TEST\"));\n }", "class_method_signature": "TextUtilTest.string2Unicode()", "constructor": false, "full_signature": "@Test public void string2Unicode()", "identifier...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String string2Unicode(String string) {\n StringBuilder stringBuilder = new StringBuilder();\n for (int i = 0; i < string.length(); i++) {\n char c = string.charAt(i);\n stringBuilder.append(\"\\\\u\");\n String hex = Integer.toHexString(c);\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_12
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void MD5() {\n assertEquals(\"033bd94b1168d7e4f0d644c3c95e35bf\", TextUtil.MD5(\"TEST\"));\n }", "class_method_signature": "TextUtilTest.MD5()", "constructor": false, "full_signature": "@Test public void MD5()", "identifier": "MD5", "invocations": [ "assertEquals",...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String MD5(String content) {\n return bytes2Hex(digest(content.getBytes(), \"MD5\"));\n }", "class_method_signature": "TextUtil.MD5(String content)", "constructor": false, "full_signature": "public static String MD5(String content)", "identifier": "MD5", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_45
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void setLongBit() {\n assertEquals(\"1011\", BitUtil.long2Bin(BitUtil.setLongBit(BitUtil.bin2Long(\"1011\"), 2, true)));\n assertEquals(\"1011\", BitUtil.long2Bin(BitUtil.setLongBit(BitUtil.bin2Long(\"1001\"), 2, true)));\n assertEquals(\"1001\", BitUtil.long2Bin(BitU...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static long setLongBit(long source, int pos, boolean value) {\n if (getLongBit(source, pos) == value) return source;\n pos = pos - 1;\n long bitValue = 1 << pos;\n if (value) {\n return source | bitValue;\n } else {\n return source ^ bitValue;...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_53
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isBankCard() {\n assertTrue(RegexUtil.isBankCard(\"6222600260001072444\"));\n }", "class_method_signature": "RegexUtilTest.isBankCard()", "constructor": false, "full_signature": "@Test public void isBankCard()", "identifier": "isBankCard", "invocations": [ "as...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isBankCard(String card) {\n if (card == null) return false;\n card = card.replace(\" \", \"\");\n return card.matches(\"^\\\\d{16,19}$\");\n }", "class_method_signature": "RegexUtil.isBankCard(String card)", "constructor": false, "full_signature": "public...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_52
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isEmail() {\n assertTrue(RegexUtil.isEmail(\"name_001@qq.com\"));\n }", "class_method_signature": "RegexUtilTest.isEmail()", "constructor": false, "full_signature": "@Test public void isEmail()", "identifier": "isEmail", "invocations": [ "assertTrue", "isE...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isEmail(String email) {\n if (email == null) return false;\n return email.matches(\"^([a-zA-Z0-9_\\\\.\\\\-])+\\\\@(([a-zA-Z0-9\\\\-])+\\\\.)+([a-zA-Z0-9]{2,4})+$\");\n }", "class_method_signature": "RegexUtil.isEmail(String email)", "constructor": false, "full_...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_44
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getLongBit() {\n assertTrue(BitUtil.getLongBit(4, 3));\n assertFalse(BitUtil.getLongBit(4, 2));\n }", "class_method_signature": "BitUtilTest.getLongBit()", "constructor": false, "full_signature": "@Test public void getLongBit()", "identifier": "getLongBit", ...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static boolean getLongBit(long source, int pos) {\n pos = pos - 1;\n long bitValue = 1 << pos;\n return (source & bitValue) == bitValue;\n }", "class_method_signature": "BitUtil.getLongBit(long source, int pos)", "constructor": false, "full_signature": "public static bo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_13
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void SHA1() {\n assertEquals(\"984816fd329622876e14907634264e6f332e9fb3\", TextUtil.SHA1(\"TEST\"));\n }", "class_method_signature": "TextUtilTest.SHA1()", "constructor": false, "full_signature": "@Test public void SHA1()", "identifier": "SHA1", "invocations": [ "a...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String SHA1(String content) {\n return bytes2Hex(digest(content.getBytes(), \"SHA-1\"));\n }", "class_method_signature": "TextUtil.SHA1(String content)", "constructor": false, "full_signature": "public static String SHA1(String content)", "identifier": "SHA1", "invocations...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_29
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void unicode2String() {\n assertEquals(\"TEST\", TextUtil.unicode2String(\"\\\\u0054\\\\u0045\\\\u0053\\\\u0054\"));\n }", "class_method_signature": "TextUtilTest.unicode2String()", "constructor": false, "full_signature": "@Test public void unicode2String()", "identifier...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String unicode2String(String unicode) {\n StringBuilder stringBuilder = new StringBuilder();\n\n String[] hex = unicode.split(\"\\\\\\\\u\");\n\n for (int i = 1; i < hex.length; i++) {\n int data = Integer.parseInt(hex[i], 16);\n stringBuilder.append...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_48
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isPhoneNumber() {\n assertTrue(RegexUtil.isPhoneNumber(\"08387450459\"));\n assertTrue(RegexUtil.isPhoneNumber(\"0838-7450459\"));\n assertTrue(RegexUtil.isPhoneNumber(\"8608387450459\"));\n assertTrue(RegexUtil.isPhoneNumber(\"+8608387450459\"));\n }",...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isPhoneNumber(String num) {\n if (num == null) return false;\n num = num.replace(\" \", \"\");\n num = num.replaceAll(\"^\\\\+?86\", \"\");\n return num.matches(\"^0\\\\d{2,3}-?[1-9]\\\\d{4,7}$\");\n }", "class_method_signature": "RegexUtil.isPhoneNumb...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_33
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void number2Chinese() {\n assertEquals(\"一亿零二百四十万零九十\", TextUtil.number2Chinese(102400090));\n }", "class_method_signature": "TextUtilTest.number2Chinese()", "constructor": false, "full_signature": "@Test public void number2Chinese()", "identifier": "number2Chinese", "...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String number2Chinese(long number) {\n String sn = String.valueOf(number);\n String result = \"\";\n if (sn.length() == 1) { // 个\n result += number2Chinese((int) number);\n return result;\n } else if (sn.length() == 2) { // 十\n if ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_7
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bytes2LongLittleEndian() {\n assertEquals(0x3412L, ByteUtil.bytes2LongLittleEndian((byte) 0x12, (byte) 0x34));\n assertEquals(0xAB9078563412L, ByteUtil.bytes2LongLittleEndian((byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x90, (byte) 0xAB));\n }", "cla...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static long bytes2LongLittleEndian(byte... bytes) {\n long result = 0;\n for (int i = 0; i < bytes.length; i++) {\n result |= ((long) (bytes[i] & 0xFF)) << (i * 8);\n if (i == 7) break;\n }\n return result;\n }", "class_method_signature": "ByteU...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_25
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hmac() {\n }", "class_method_signature": "TextUtilTest.hmac()", "constructor": false, "full_signature": "@Test public void hmac()", "identifier": "hmac", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void hmac...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static byte[] Hmac(byte[] data, String algorithm, byte[] key) {\n SecretKey secretKey = new SecretKeySpec(key, algorithm);\n Mac mac = null;\n try {\n mac = Mac.getInstance(algorithm);\n mac.init(secretKey);\n return mac.doFinal(data);\n }...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_30
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void formetByteLength() {\n assertEquals(\"1.00KB\", TextUtil.formetByteLength(1024));\n assertEquals(\"1.00MB\", TextUtil.formetByteLength(1024 * 1024));\n assertEquals(\"1.00GB\", TextUtil.formetByteLength(1024 * 1024 * 1024));\n assertEquals(\"1.05GB\", Text...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String formetByteLength(long size) {\n String fileSizeString = \"\";\n if (size < 1024) {\n fileSizeString = size + \"B\";\n } else if (size < 1048576) {\n fileSizeString = decimalFormat.format(size / 1024.0) + \"KB\";\n } else if (size < 1073...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_26
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void encodeURL() {\n assertEquals(\"https%3A%2F%2F6xyun.cn%2Fapi%3Fkey%3D%E6%B5%8B%E8%AF%95\", TextUtil.encodeURL(\"https://6xyun.cn/api?key=测试\", null));\n }", "class_method_signature": "TextUtilTest.encodeURL()", "constructor": false, "full_signature": "@Test public void...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String encodeURL(String data, String enc) {\n try {\n if (isEmpty(enc)) enc = \"utf-8\";\n return URLEncoder.encode(data, enc);\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n return data;\n }", "class...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_4
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void int2BytesLittleEndian() {\n assertArrayEquals(new byte[]{(byte) 0x34, (byte) 0x12, 0, 0}, ByteUtil.int2BytesLittleEndian(0x1234));\n assertArrayEquals(new byte[]{(byte) 0x78, (byte) 0x56, (byte) 0x34, (byte) 0x12}, ByteUtil.int2BytesLittleEndian(0x12345678));\n }", ...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static byte[] int2BytesLittleEndian(int i) {\n byte[] bytes = new byte[4];\n bytes[0] = (byte) (i & 0xff);\n bytes[1] = (byte) ((i >> 8) & 0xff);\n bytes[2] = (byte) ((i >> 16) & 0xff);\n bytes[3] = (byte) ((i >> 24) & 0xff);\n return bytes;\n }", "clas...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_51
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isVehicleLicence() {\n assertTrue(RegexUtil.isVehicleLicence(\"川A12345\"));\n assertTrue(RegexUtil.isVehicleLicence(\"川A54374D\"));\n }", "class_method_signature": "RegexUtilTest.isVehicleLicence()", "constructor": false, "full_signature": "@Test public void is...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isVehicleLicence(String license) {\n if (license == null) return false;\n return license.matches(\"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领])...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_47
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isCellphoneNumber() {\n assertTrue(RegexUtil.isCellphoneNumber(\"13086668581\"));\n assertTrue(RegexUtil.isCellphoneNumber(\"17108387204\", true));\n assertFalse(RegexUtil.isCellphoneNumber(\"17108387204\", false));\n }", "class_method_signature": "RegexUtil...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isCellphoneNumber(String num) {\n return isCellphoneNumber(num, true);\n }", "class_method_signature": "RegexUtil.isCellphoneNumber(String num)", "constructor": false, "full_signature": "public static boolean isCellphoneNumber(String num)", "identifier": "isCellphone...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_10
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bbc() {\n assertEquals((byte) 0x29, ByteUtil.bbc(TextUtil.hex2Bytes(\"78 B0 00 01 01 42 00 00 00 01 00 00 00 00 00 00 09 5A FF FF F1 00 00 00 00 00 00 00\")));\n }", "class_method_signature": "ByteUtilTest.bbc()", "constructor": false, "full_signature": "@Test public ...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static byte bbc(byte... datas){\n byte bbc = 0x00;\n for (int i = 0; i < datas.length; i++) {\n bbc ^= datas[i];\n }\n return bbc;\n }", "class_method_signature": "ByteUtil.bbc(byte... datas)", "constructor": false, "full_signature": "public static byt...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_8
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void reverse() {\n assertArrayEquals(new byte[]{(byte) 0x78, (byte) 0x56, (byte) 0x34, (byte) 0x12}, ByteUtil.reverse((byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78));\n }", "class_method_signature": "ByteUtilTest.reverse()", "constructor": false, "full_signature": "@T...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static byte[] reverse(byte... bytes) {\n int length = bytes.length;\n byte[] result = new byte[length];\n for (int i = 0; i < length; i++) {\n result[length - i - 1] = bytes[i];\n }\n return result;\n }", "class_method_signature": "ByteUtil.reverse(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_9
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bytesIndexOf() {\n assertEquals(2, ByteUtil.bytesIndexOf(new byte[]{(byte) 0xF1, (byte) 0xF2, (byte) 0xF3, (byte) 0xF4, (byte) 0xF5, (byte) 0xF6}, new byte[]{(byte) 0xF3, (byte) 0xF4}, 0));\n }", "class_method_signature": "ByteUtilTest.bytesIndexOf()", "constructor": fa...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static int bytesIndexOf(byte[] source, byte[] target, int begin) {\n if (source == null || target == null || target.length == 0 || source.length < target.length) return -1;\n\n int i, j, max = source.length - target.length;\n for (i = begin; i <= max; i++) {\n if (sou...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_11
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void crc16() {\n assertArrayEquals(new byte[]{(byte) 0xf5, (byte) 0xf4}, ByteUtil.crc16Modbus(TextUtil.hex2Bytes(\"00 64 FF FF 62 25 00 15 01 00 02 15 01 03 00 FF 00 00 00 00 00 00 00 12 00 BB B6 D3 AD B9 E2 C1 D9 C7 EB C8 EB B3 A1 CD A3 B3 B5\")));\n }", "class_method_signatu...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static byte[] crc16Modbus(byte... datas) {\n int CRC = 0x0000ffff;\n int POLYNOMIAL = 0x0000a001;\n\n int i, j;\n for (i = 0; i < datas.length; i++) {\n CRC ^= ((int) datas[i] & 0x000000ff);\n for (j = 0; j < 8; j++) {\n if ((CRC & 0x0...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_46
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isIdentityNumber() {\n assertTrue(RegexUtil.isIdentityNumber(\"510101199001011119\"));\n assertFalse(RegexUtil.isIdentityNumber(\"510101199001011110\"));\n }", "class_method_signature": "RegexUtilTest.isIdentityNumber()", "constructor": false, "full_signature":...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isIdentityNumber(String num) {\n // 地区码\n String area = \"(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|82|[7-9]1)[0-9]{4}\";\n // 普通年份\n String year = \"(19|20)[0-9]{2}\";\n String mmdd = \"(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_50
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isName() {\n assertTrue(RegexUtil.isName(\"李荣浩\"));\n assertTrue(RegexUtil.isName(\"尼格买提·买买提·阿凡提\"));\n }", "class_method_signature": "RegexUtilTest.isName()", "constructor": false, "full_signature": "@Test public void isName()", "identifier": "isName", "in...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isName(String name) {\n if (name == null) return false;\n return name.matches(\"^[\\\\u4e00-\\\\u9fa5]+([·•][\\\\u4e00-\\\\u9fa5]+)*$\");\n }", "class_method_signature": "RegexUtil.isName(String name)", "constructor": false, "full_signature": "public static bool...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_27
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void decodeURL() {\n assertEquals(\"https://6xyun.cn/api?key=测试\", TextUtil.decodeURL(\"https%3a%2f%2f6xyun.cn%2fapi%3fkey%3d%e6%b5%8b%e8%af%95\", null));\n }", "class_method_signature": "TextUtilTest.decodeURL()", "constructor": false, "full_signature": "@Test public void...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String decodeURL(String data, String enc) {\n try {\n if (isEmpty(enc)) enc = \"utf-8\";\n return URLDecoder.decode(data, enc);\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n return data;\n }", "class...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_5
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bytes2IntLittleEndian() {\n assertEquals(0x3412, ByteUtil.bytes2IntLittleEndian((byte) 0x12, (byte) 0x34));\n assertEquals(0x78563412, ByteUtil.bytes2IntLittleEndian((byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78));\n }", "class_method_signature": "ByteUtilTest...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static int bytes2IntLittleEndian(byte... bytes) {\n int result = 0;\n for (int i = 0; i < bytes.length; i++) {\n result |= (bytes[i] & 0xFF) << (i * 8);\n if (i == 3) break;\n }\n return result;\n }", "class_method_signature": "ByteUtil.bytes2In...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_31
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void money2Chinese() {\n assertEquals(\"一亿零二百四十万零九十元整\", TextUtil.money2Chinese(102400090));\n }", "class_method_signature": "TextUtilTest.money2Chinese()", "constructor": false, "full_signature": "@Test public void money2Chinese()", "identifier": "money2Chinese", "inv...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String money2Chinese(double money) {\n long yuan = (long) money;\n\n String result = number2Chinese(yuan) + \"元\";\n String jiaoFen = null;\n int fen = (int) (money * 100 % 100);\n if (fen > 0) {\n jiaoFen = \"\";\n if (fen > 9) {\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_57
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isComplexPassword() {\n assertFalse(RegexUtil.isComplexPassword(\"123456789\"));\n assertFalse(RegexUtil.isComplexPassword(\"qwerQWER\"));\n assertTrue(RegexUtil.isComplexPassword(\"QWER0000\"));\n assertTrue(RegexUtil.isComplexPassword(\"QWER0000.~@.,;'\"...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isComplexPassword(String password) {\n if (!isPassword(password)) return false;\n return password.matches(\"^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z`~!@#$%^&*()\\\\-_=+\\\\[\\\\]{};:'\\\"\\\\\\\\|,<.>/?]{6,16}$\");\n }", "class_method_signature": "RegexUtil.isComplexPas...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_41
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bin2Long() {\n assertEquals(4294967296L, BitUtil.bin2Long(\"1_0000_0000_0000_0000_0000_0000_0000_0000\".replace(\"_\", \"\")));\n assertEquals(4294967296L, BitUtil.bin2Long(\"0b1_0000_0000_0000_0000_0000_0000_0000_0000\".replace(\"_\", \"\")));\n }", "class_method_...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static long bin2Long(String source) {\n if (source.startsWith(\"0b\")) source = source.substring(2);\n return Long.parseLong(source, 2);\n }", "class_method_signature": "BitUtil.bin2Long(String source)", "constructor": false, "full_signature": "public static long bin2Long(Stri...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_16
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void SHA384() {\n assertEquals(\"4f37c49c0024445f91977dbc47bd4da9c4de8d173d03379ee19c2bb15435c2c7e624ea42f7cc1689961cb7aca50c7d17\", TextUtil.SHA384(\"TEST\"));\n }", "class_method_signature": "TextUtilTest.SHA384()", "constructor": false, "full_signature": "@Test public v...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String SHA384(String content) {\n return bytes2Hex(digest(content.getBytes(), \"SHA-384\"));\n }", "class_method_signature": "TextUtil.SHA384(String content)", "constructor": false, "full_signature": "public static String SHA384(String content)", "identifier": "SHA384", "i...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_36
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void encodeBase64() {\n assertEquals(\"VEVTVA==\", TextUtil.encodeBase64(\"TEST\".getBytes()));\n }", "class_method_signature": "TextUtilTest.encodeBase64()", "constructor": false, "full_signature": "@Test public void encodeBase64()", "identifier": "encodeBase64", "inv...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String encodeBase64(byte[] content) {\n return Base64.encodeToString(content, Base64.NO_WRAP);\n }", "class_method_signature": "TextUtil.encodeBase64(byte[] content)", "constructor": false, "full_signature": "public static String encodeBase64(byte[] content)", "identifier": ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_2
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void long2BytesBigEndian() {\n assertArrayEquals(new byte[]{0, 0, 0, 0, 0 , 0, (byte) 0x12, (byte) 0x34}, ByteUtil.long2BytesBigEndian(0x1234L));\n assertArrayEquals(new byte[]{0, 0, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x90, (byte) 0xAB}, ByteUtil.long...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static byte[] long2BytesBigEndian(long l) {\n byte[] bytes = new byte[8];\n bytes[0] = (byte) ((l >> 56) & 0xff);\n bytes[1] = (byte) ((l >> 48) & 0xff);\n bytes[2] = (byte) ((l >> 40) & 0xff);\n bytes[3] = (byte) ((l >> 32) & 0xff);\n bytes[4] = (byte) ((l ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_20
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hmacSHA1() {\n assertEquals(\"7403a7476a1758ff716b8bd405d0ef5574e9cd0a\", TextUtil.HmacSHA1(\"TEST\", \"KEY\"));\n }", "class_method_signature": "TextUtilTest.hmacSHA1()", "constructor": false, "full_signature": "@Test public void hmacSHA1()", "identifier": "hmacSHA...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String HmacSHA1(String content, String key) {\n return bytes2Hex(Hmac(content.getBytes(), \"HmacSHA1\", key.getBytes()));\n }", "class_method_signature": "TextUtil.HmacSHA1(String content, String key)", "constructor": false, "full_signature": "public static String HmacSHA1(Str...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_3
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void bytes2LongBigEndian() {\n assertEquals(0x1234L, ByteUtil.bytes2LongBigEndian((byte) 0x12, (byte) 0x34));\n assertEquals(0x1234567890ABL, ByteUtil.bytes2LongBigEndian((byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x90, (byte) 0xAB));\n }", "class_method...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/ByteUtil.java", "identifier": "ByteUtil", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtil.int2BytesBigEndian(int i)", "constructor": false, "full_signature": "public static byte[] int2BytesBigEndian(in...
{ "body": "public static long bytes2LongBigEndian(byte... bytes) {\n long result = 0L;\n if (bytes == null || bytes.length == 0) return result;\n result |= (bytes[0] & 0xff);\n for (int i = 1; i < bytes.length; i++) {\n result = result << 8;\n result |= (bytes[i] & 0x...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_21
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hmacSHA224() {\n assertEquals(\"e802b12b9dbfca2785fb1d93864eb984494e110acefe468fea6a3f79\", TextUtil.HmacSHA224(\"TEST\", \"KEY\"));\n }", "class_method_signature": "TextUtilTest.hmacSHA224()", "constructor": false, "full_signature": "@Test public void hmacSHA224()", ...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String HmacSHA224(String content, String key) {\n return bytes2Hex(Hmac(content.getBytes(), \"HmacSHA224\", key.getBytes()));\n }", "class_method_signature": "TextUtil.HmacSHA224(String content, String key)", "constructor": false, "full_signature": "public static String HmacSH...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_37
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void decodeBase64() {\n assertArrayEquals(TextUtil.hex2Bytes(\"54 45 53 54\"), TextUtil.decodeBase64(\"VEVTVA==\"));\n }", "class_method_signature": "TextUtilTest.decodeBase64()", "constructor": false, "full_signature": "@Test public void decodeBase64()", "identifier": "...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static byte[] decodeBase64(String content) {\n return Base64.decode(content, Base64.NO_WRAP);\n }", "class_method_signature": "TextUtil.decodeBase64(String content)", "constructor": false, "full_signature": "public static byte[] decodeBase64(String content)", "identifier": "decodeB...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_60
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isIp6Address() {\n assertTrue(RegexUtil.isIp6Address(\"fe80:0:0:0:20c:29ff:fe6b:2516\"));\n assertTrue(RegexUtil.isIp6Address(\"1040::1\"));\n }", "class_method_signature": "RegexUtilTest.isIp6Address()", "constructor": false, "full_signature": "@Test public vo...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isIp6Address(String address) {\n if (address == null) return false;\n return address.matches(\"^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_17
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void SHA512() {\n assertEquals(\"7bfa95a688924c47c7d22381f20cc926f524beacb13f84e203d4bd8cb6ba2fce81c57a5f059bf3d509926487bde925b3bcee0635e4f7baeba054e5dba696b2bf\", TextUtil.SHA512(\"TEST\"));\n }", "class_method_signature": "TextUtilTest.SHA512()", "constructor": false, "...
{ "fields": [ { "declarator": "TAG = \"TextUtil\"", "modifier": "private final", "original_string": "private final String TAG = \"TextUtil\";", "type": "String", "var_name": "TAG" }, { "declarator": "decimalFormat = new DecimalFormat(\"0.00\")", "modifier": "priva...
{ "body": "public static String SHA512(String content) {\n return bytes2Hex(digest(content.getBytes(), \"SHA-512\"));\n }", "class_method_signature": "TextUtil.SHA512(String content)", "constructor": false, "full_signature": "public static String SHA512(String content)", "identifier": "SHA512", "i...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_40
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/BitUtilTest.java", "identifier": "BitUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void long2Bin() {\n assertEquals(\"1_0000_0000_0000_0000_0000_0000_0000_0000\".replace(\"_\", \"\"), BitUtil.long2Bin(4294967296L));\n }", "class_method_signature": "BitUtilTest.long2Bin()", "constructor": false, "full_signature": "@Test public void long2Bin()", "identif...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/BitUtil.java", "identifier": "BitUtil", "interfaces": "", "methods": [ { "class_method_signature": "BitUtil.int2Bin(int source)", "constructor": false, "full_signature": "public static String int2Bin(int source)", "i...
{ "body": "public static String long2Bin(long source) {\n return Long.toBinaryString(source);\n }", "class_method_signature": "BitUtil.long2Bin(long source)", "constructor": false, "full_signature": "public static String long2Bin(long source)", "identifier": "long2Bin", "invocations": [ "toBin...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
119475284_56
{ "fields": [], "file": "util/src/test/java/com/liux/android/util/RegexUtilTest.java", "identifier": "RegexUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isPassword() {\n assertTrue(RegexUtil.isPassword(\"123456789\"));\n }", "class_method_signature": "RegexUtilTest.isPassword()", "constructor": false, "full_signature": "@Test public void isPassword()", "identifier": "isPassword", "invocations": [ "assertTrue",...
{ "fields": [], "file": "util/src/main/java/com/liux/android/util/RegexUtil.java", "identifier": "RegexUtil", "interfaces": "", "methods": [ { "class_method_signature": "RegexUtil.isIdentityNumber(String num)", "constructor": false, "full_signature": "public static boolean isIdentityNumb...
{ "body": "public static boolean isPassword(String password) {\n if (password == null) return false;\n\n if (password.length() < 6 || password.length() > 16) return false;\n\n return password.matches(\"^[0-9a-zA-Z~!@#\\\\$%\\\\^&\\\\*\\\\(\\\\)_\\\\\\\\+-=:\\\";'<>?,\\\\.\\\\/]{6,16}$\");\n }"...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 119475284, "size": 6354, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/lx0758/Android-Librarys" }
170883666_70
{ "fields": [ { "declarator": "DEFAULT_FIELD_ONE = \"a\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_FIELD_ONE = \"a\";", "type": "String", "var_name": "DEFAULT_FIELD_ONE" }, { "declarator": "DEFAULT_FIELD_TWO = \"b\"", ...
{ "body": "@Test\n public void shouldThrowExceptionGivenTwoSchemasWithSameFieldButDifferentType() {\n Schema schemaLeft = SchemaBuilder.struct()\n .field(DEFAULT_FIELD_ONE, Schema.STRING_SCHEMA)\n .build();\n\n\n Schema schemaRight = SchemaBuilder.struct()\n ...
{ "fields": [], "file": "connect-file-pulse-api/src/main/java/io/streamthoughts/kafka/connect/filepulse/internal/SchemaUtils.java", "identifier": "SchemaUtils", "interfaces": "", "methods": [ { "class_method_signature": "SchemaUtils.getAllFieldNames(final Schema schema)", "constructor": false,...
{ "body": "public static void merge(final Schema leftSchema,\n final Schema rightSchema,\n final SchemaBuilder builder,\n final Set<String> overwrite) {\n final Map<String, Field> rightFields = groupFieldByName(rightSchema.fiel...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_27
{ "fields": [ { "declarator": "folder = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder folder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "folder" }, { "declarator": "succeedDirectory"...
{ "body": "@Test\n public void shouldMoveFileGivenFailedSource() {\n\n MoveCleanupPolicy policy = new MoveCleanupPolicy();\n policy.configure(config);\n\n Boolean result = policy.apply(source.withStatus(SourceStatus.FAILED));\n assertTrue(Files.exists(Paths.get(failedDirectory.getAbsolu...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(MoveCleanupPolicy.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(MoveCleanupPolicy.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "@Override\n public void configure(final Map<String, ?> configs) {\n this.configs = new MoveFileCleanerConfig(configs);\n }", "class_method_signature": "MoveCleanupPolicy.configure(final Map<String, ?> configs)", "constructor": false, "full_signature": "@Override public void configure(fin...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_31
{ "fields": [ { "declarator": "metadata = new SourceMetadata(\n \"test\",\n \"/tmp/path\",\n 0L,\n 123L,\n 456L,\n 789L\n )", "modifier": "private static final", "original_string": "private static final SourceMetadata metadata ...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void should_throw_illegal_argument_given_unknown_strategy() {\n new ComposeOffsetStrategy(\"dummy\").toPartitionMap(metadata);\n }", "class_method_signature": "ComposeOffsetStrategyTest.should_throw_illegal_argument_given_unknown_stra...
{ "fields": [ { "declarator": "FILEPATH_FIELD = \"path\"", "modifier": "private static final", "original_string": "private static final String FILEPATH_FIELD = \"path\";", "type": "String", "var_name": "FILEPATH_FIELD" }, { "declarator": "FILENAME_FIELD = \"name\"", ...
{ "body": "@Override\n public Map<String, Object> toPartitionMap(final SourceMetadata metadata) {\n Map<String, Object> offset = new LinkedHashMap<>();\n for (GenericOffsetStrategy strategy : strategies) {\n strategy.addAttributeToPartitionMap(metadata, offset);\n }\n return ...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_66
{ "fields": [ { "declarator": "DEFAULT_FIELD_ONE = \"a\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_FIELD_ONE = \"a\";", "type": "String", "var_name": "DEFAULT_FIELD_ONE" }, { "declarator": "DEFAULT_FIELD_TWO = \"b\"", ...
{ "body": "@Test\n public void shouldMergeSchemasGivenTwoFieldsWithSameNameIntoArray() {\n Schema schemaLeft = SchemaBuilder.struct()\n .field(DEFAULT_FIELD_ONE, Schema.STRING_SCHEMA)\n .build();\n\n Schema schemaRight = SchemaBuilder.struct()\n .field(DEF...
{ "fields": [], "file": "connect-file-pulse-api/src/main/java/io/streamthoughts/kafka/connect/filepulse/internal/SchemaUtils.java", "identifier": "SchemaUtils", "interfaces": "", "methods": [ { "class_method_signature": "SchemaUtils.getAllFieldNames(final Schema schema)", "constructor": false,...
{ "body": "public static void merge(final Schema leftSchema,\n final Schema rightSchema,\n final SchemaBuilder builder,\n final Set<String> overwrite) {\n final Map<String, Field> rightFields = groupFieldByName(rightSchema.fiel...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_11
{ "fields": [], "file": "connect-file-pulse-expression/src/test/java/io/streamthoughts/kafka/connect/filepulse/expression/parser/antlr4/Antlr4ExpressionParserTest.java", "identifier": "Antlr4ExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_parse_substitution_expression_given_property_with_scope_an_space() {\n final String strExpression = \"prefix-{{ $scope }}\";\n Expression expression = new Antlr4ExpressionParser().parseExpression(strExpression);\n assertSubstitutionException(\n ...
{ "fields": [ { "declarator": "DEFAULT_ROOT_OBJECT = \"value\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_ROOT_OBJECT = \"value\";", "type": "String", "var_name": "DEFAULT_ROOT_OBJECT" } ], "file": "connect-file-pulse-express...
{ "body": "@Override\n public Expression parseExpression(final String expression) throws ExpressionException {\n return parseExpression(expression, DEFAULT_ROOT_OBJECT);\n }", "class_method_signature": "Antlr4ExpressionParser.parseExpression(final String expression)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_46
{ "fields": [ { "declarator": "NOW = System.currentTimeMillis()", "modifier": "private static final", "original_string": "private static final long NOW = System.currentTimeMillis();", "type": "long", "var_name": "NOW" }, { "declarator": "DEFAULT_TEST_SCHEMA", "mod...
{ "body": "@Test\n public void shouldSeekToGivenAValidPosition() {\n\n writeGenericRecords(\n DEFAULT_TEST_SCHEMA,\n DEFAULT_GENERIC_RECORD,\n DEFAULT_GENERIC_RECORD,\n DEFAULT_GENERIC_RECORD);\n\n FileInputIterator<FileRecord<TypedStruct>> ...
{ "fields": [], "file": "connect-file-pulse-plugin/src/main/java/io/streamthoughts/kafka/connect/filepulse/reader/AvroFileInputReader.java", "identifier": "AvroFileInputReader", "interfaces": "", "methods": [ { "class_method_signature": "AvroFileInputReader.AvroFileInputReader()", "constructor...
{ "body": "@Override\n protected FileInputIterator<FileRecord<TypedStruct>> newIterator(final FileContext context,\n final IteratorManager iteratorManager) {\n return new AvroFileIterator(iteratorManager, context);\n }", "class_method_...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_50
{ "fields": [ { "declarator": "converter = new DefaultJSONStructConverter()", "modifier": "private", "original_string": "private JSONStructConverter converter = new DefaultJSONStructConverter();", "type": "JSONStructConverter", "var_name": "converter" } ], "file": "connect-fi...
{ "body": "@Test\n public void shouldConvertGivenOneFieldWithArrayOfPrimitiveType() throws Exception {\n\n TypedValue value = converter.readJson(\"{\\\"field-one\\\" : [\\\"foo\\\", \\\"bar\\\"]}\");\n\n Assert.assertNotNull(value);\n Assert.assertEquals(Type.STRUCT, value.type());\n Ty...
{ "fields": [ { "declarator": "ACCESSORS = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<ValueType, JsonFieldAccessor<?>> ACCESSORS = new HashMap<>();", "type": "Map<ValueType, JsonFieldAccessor<?>>", "var_name": "ACCESSORS" } ...
{ "body": "@Override\n public TypedValue readJson(final String data) {\n\n if (data == null) return null;\n\n try {\n JsonIterator it = JsonIterator.parse(data);\n return getAccessorForType(it.whatIsNext()).read(it);\n\n } catch (Exception e) {\n throw new Read...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_6
{ "fields": [], "file": "connect-file-pulse-expression/src/test/java/io/streamthoughts/kafka/connect/filepulse/expression/parser/antlr4/Antlr4ExpressionParserTest.java", "identifier": "Antlr4ExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_parse_value_expression_given_string_literal() {\n Expression expression = new Antlr4ExpressionParser().parseExpression(\"'hello'\");\n Assert.assertTrue(expression instanceof ValueExpression);\n Assert.assertEquals(\"'hello'\", expression.originalExpressio...
{ "fields": [ { "declarator": "DEFAULT_ROOT_OBJECT = \"value\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_ROOT_OBJECT = \"value\";", "type": "String", "var_name": "DEFAULT_ROOT_OBJECT" } ], "file": "connect-file-pulse-express...
{ "body": "@Override\n public Expression parseExpression(final String expression) throws ExpressionException {\n return parseExpression(expression, DEFAULT_ROOT_OBJECT);\n }", "class_method_signature": "Antlr4ExpressionParser.parseExpression(final String expression)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_7
{ "fields": [], "file": "connect-file-pulse-expression/src/test/java/io/streamthoughts/kafka/connect/filepulse/expression/parser/antlr4/Antlr4ExpressionParserTest.java", "identifier": "Antlr4ExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_parse_value_expression_given_boolean_literal() {\n Expression expression = new Antlr4ExpressionParser().parseExpression(\"true\");\n Assert.assertTrue(expression instanceof ValueExpression);\n Assert.assertEquals(\"true\", expression.originalExpression());...
{ "fields": [ { "declarator": "DEFAULT_ROOT_OBJECT = \"value\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_ROOT_OBJECT = \"value\";", "type": "String", "var_name": "DEFAULT_ROOT_OBJECT" } ], "file": "connect-file-pulse-express...
{ "body": "@Override\n public Expression parseExpression(final String expression) throws ExpressionException {\n return parseExpression(expression, DEFAULT_ROOT_OBJECT);\n }", "class_method_signature": "Antlr4ExpressionParser.parseExpression(final String expression)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_51
{ "fields": [ { "declarator": "converter = new DefaultJSONStructConverter()", "modifier": "private", "original_string": "private JSONStructConverter converter = new DefaultJSONStructConverter();", "type": "JSONStructConverter", "var_name": "converter" } ], "file": "connect-fi...
{ "body": "@Test\n public void shouldConvertGivenFieldsWithNumberType() throws Exception {\n\n TypedValue value = converter.readJson(\"{\\\"field-int\\\" : \" + Integer.MAX_VALUE + \", \" +\n \"\\\"field-long\\\":\" + Long.MAX_VALUE + \", \" +\n \"\\\"field-double\\...
{ "fields": [ { "declarator": "ACCESSORS = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<ValueType, JsonFieldAccessor<?>> ACCESSORS = new HashMap<>();", "type": "Map<ValueType, JsonFieldAccessor<?>>", "var_name": "ACCESSORS" } ...
{ "body": "@Override\n public TypedValue readJson(final String data) {\n\n if (data == null) return null;\n\n try {\n JsonIterator it = JsonIterator.parse(data);\n return getAccessorForType(it.whatIsNext()).read(it);\n\n } catch (Exception e) {\n throw new Read...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_47
{ "fields": [ { "declarator": "converter = new DefaultJSONStructConverter()", "modifier": "private", "original_string": "private JSONStructConverter converter = new DefaultJSONStructConverter();", "type": "JSONStructConverter", "var_name": "converter" } ], "file": "connect-fi...
{ "body": "@Test\n public void shouldConvertGivenArrayOfComplexType() throws Exception {\n TypedValue struct = converter.readJson(\"[{\\\"firstName\\\": \\\"foo\\\"}, {\\\"firstName\\\": \\\"bar\\\"}]\");\n Assert.assertNotNull(struct);\n }", "class_method_signature": "DefaultJSONStructConverter...
{ "fields": [ { "declarator": "ACCESSORS = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<ValueType, JsonFieldAccessor<?>> ACCESSORS = new HashMap<>();", "type": "Map<ValueType, JsonFieldAccessor<?>>", "var_name": "ACCESSORS" } ...
{ "body": "@Override\n public TypedValue readJson(final String data) {\n\n if (data == null) return null;\n\n try {\n JsonIterator it = JsonIterator.parse(data);\n return getAccessorForType(it.whatIsNext()).read(it);\n\n } catch (Exception e) {\n throw new Read...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_10
{ "fields": [], "file": "connect-file-pulse-expression/src/test/java/io/streamthoughts/kafka/connect/filepulse/expression/parser/antlr4/Antlr4ExpressionParserTest.java", "identifier": "Antlr4ExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_parse_substitution_expression_containing_literal_and_function() {\n final String strExpression = \"{{ '$.'lowercase($.field) }}\";\n Expression expression = new Antlr4ExpressionParser().parseExpression(strExpression);\n assertSubstitutionException(\n ...
{ "fields": [ { "declarator": "DEFAULT_ROOT_OBJECT = \"value\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_ROOT_OBJECT = \"value\";", "type": "String", "var_name": "DEFAULT_ROOT_OBJECT" } ], "file": "connect-file-pulse-express...
{ "body": "@Override\n public Expression parseExpression(final String expression) throws ExpressionException {\n return parseExpression(expression, DEFAULT_ROOT_OBJECT);\n }", "class_method_signature": "Antlr4ExpressionParser.parseExpression(final String expression)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_67
{ "fields": [ { "declarator": "DEFAULT_FIELD_ONE = \"a\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_FIELD_ONE = \"a\";", "type": "String", "var_name": "DEFAULT_FIELD_ONE" }, { "declarator": "DEFAULT_FIELD_TWO = \"b\"", ...
{ "body": "@Test\n public void shouldMergeSchemasGivenLeftFieldWithArrayTypeEqualToRightField() {\n Schema schemaLeft = SchemaBuilder.struct()\n .field(DEFAULT_FIELD_ONE, SchemaBuilder.array(SchemaBuilder.string()))\n .build();\n\n Schema schemaRight = SchemaBuilder.stru...
{ "fields": [], "file": "connect-file-pulse-api/src/main/java/io/streamthoughts/kafka/connect/filepulse/internal/SchemaUtils.java", "identifier": "SchemaUtils", "interfaces": "", "methods": [ { "class_method_signature": "SchemaUtils.getAllFieldNames(final Schema schema)", "constructor": false,...
{ "body": "public static void merge(final Schema leftSchema,\n final Schema rightSchema,\n final SchemaBuilder builder,\n final Set<String> overwrite) {\n final Map<String, Field> rightFields = groupFieldByName(rightSchema.fiel...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_30
{ "fields": [ { "declarator": "metadata = new SourceMetadata(\n \"test\",\n \"/tmp/path\",\n 0L,\n 123L,\n 456L,\n 789L\n )", "modifier": "private static final", "original_string": "private static final SourceMetadata metadata ...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void should_throw_illegal_argument_given_empty_strategy() {\n new ComposeOffsetStrategy(\"\").toPartitionMap(metadata);\n }", "class_method_signature": "ComposeOffsetStrategyTest.should_throw_illegal_argument_given_empty_strategy()", ...
{ "fields": [ { "declarator": "FILEPATH_FIELD = \"path\"", "modifier": "private static final", "original_string": "private static final String FILEPATH_FIELD = \"path\";", "type": "String", "var_name": "FILEPATH_FIELD" }, { "declarator": "FILENAME_FIELD = \"name\"", ...
{ "body": "@Override\n public Map<String, Object> toPartitionMap(final SourceMetadata metadata) {\n Map<String, Object> offset = new LinkedHashMap<>();\n for (GenericOffsetStrategy strategy : strategies) {\n strategy.addAttributeToPartitionMap(metadata, offset);\n }\n return ...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_26
{ "fields": [ { "declarator": "folder = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder folder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "folder" }, { "declarator": "succeedDirectory"...
{ "body": "@Test\n public void shouldMoveFileGivenCompletedSource() {\n\n MoveCleanupPolicy policy = new MoveCleanupPolicy();\n policy.configure(config);\n\n Boolean result = policy.apply(source.withStatus(SourceStatus.COMPLETED));\n assertTrue(Files.exists(Paths.get(succeedDirectory.ge...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(MoveCleanupPolicy.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(MoveCleanupPolicy.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "@Override\n public void configure(final Map<String, ?> configs) {\n this.configs = new MoveFileCleanerConfig(configs);\n }", "class_method_signature": "MoveCleanupPolicy.configure(final Map<String, ?> configs)", "constructor": false, "full_signature": "@Override public void configure(fin...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_71
{ "fields": [ { "declarator": "DEFAULT_FIELD_ONE = \"a\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_FIELD_ONE = \"a\";", "type": "String", "var_name": "DEFAULT_FIELD_ONE" }, { "declarator": "DEFAULT_FIELD_TWO = \"b\"", ...
{ "body": "@Test\n public void shouldThrowExceptionGivenLeftFieldWithArrayTypeNotEqualToRightField() {\n Schema schemaLeft = SchemaBuilder.struct()\n .field(DEFAULT_FIELD_ONE, SchemaBuilder.array(SchemaBuilder.string()))\n .build();\n\n\n Schema schemaRight = SchemaBuild...
{ "fields": [], "file": "connect-file-pulse-api/src/main/java/io/streamthoughts/kafka/connect/filepulse/internal/SchemaUtils.java", "identifier": "SchemaUtils", "interfaces": "", "methods": [ { "class_method_signature": "SchemaUtils.getAllFieldNames(final Schema schema)", "constructor": false,...
{ "body": "public static void merge(final Schema leftSchema,\n final Schema rightSchema,\n final SchemaBuilder builder,\n final Set<String> overwrite) {\n final Map<String, Field> rightFields = groupFieldByName(rightSchema.fiel...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_17
{ "fields": [], "file": "connect-file-pulse-expression/src/test/java/io/streamthoughts/kafka/connect/filepulse/expression/parser/antlr4/Antlr4ExpressionParserTest.java", "identifier": "Antlr4ExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_parse_property_expression_given_property_with_default_scope() {\n final String strExpression = \"$.field.two\";\n Expression expression = new Antlr4ExpressionParser().parseExpression(strExpression);\n assertPropertyException(\n expression,\n ...
{ "fields": [ { "declarator": "DEFAULT_ROOT_OBJECT = \"value\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_ROOT_OBJECT = \"value\";", "type": "String", "var_name": "DEFAULT_ROOT_OBJECT" } ], "file": "connect-file-pulse-express...
{ "body": "@Override\n public Expression parseExpression(final String expression) throws ExpressionException {\n return parseExpression(expression, DEFAULT_ROOT_OBJECT);\n }", "class_method_signature": "Antlr4ExpressionParser.parseExpression(final String expression)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_40
{ "fields": [ { "declarator": "OFFSET_MANAGER = new SimpleOffsetManager(new ComposeOffsetStrategy(\"name\"))", "modifier": "private static final", "original_string": "private static final SimpleOffsetManager OFFSET_MANAGER = new SimpleOffsetManager(new ComposeOffsetStrategy(\"name\"));", "...
{ "body": "@Test\n public void shouldNotScannedDirectoryWhileProcessingFiles() {\n final StateSnapshot<SourceFile> state = new StateSnapshot<>(0, Collections.emptyMap());\n FileStateBackingStore store = Mockito.mock(FileStateBackingStore.class);\n Mockito.when(store.snapshot()).thenReturn(stat...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(LocalFileSystemScanner.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(LocalFileSystemScanner.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "@Override\n public void scan(final ConnectorContext context) {\n cleanUpCompletedFiles();\n if (updateFiles()) {\n LOG.info(\"Requesting task reconfiguration\");\n context.requestTaskReconfiguration();\n }\n }", "class_method_signature": "LocalFileSystemSc...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_56
{ "fields": [ { "declarator": "JSON = \" {\\\"firstName\\\" : \\\"foo\\\", \\\"lastName\\\" : \\\"bar\\\"}\"", "modifier": "private static final", "original_string": "private static final String JSON = \" {\\\"firstName\\\" : \\\"foo\\\", \\\"lastName\\\" : \\\"bar\\\"}\";", "type": ...
{ "body": "@Test\n public void should_add_parsed_json_into_source_given_no_target_field() {\n List<TypedStruct> expected = Collections.singletonList(create()\n .put(\"message\", create().put(\"firstName\", \"foo\").put(\"lastName\", \"bar\"))\n );\n assertOutput(filter.apply(nul...
{ "fields": [ { "declarator": "converter = new DefaultJSONStructConverter()", "modifier": "private final", "original_string": "private final DefaultJSONStructConverter converter = new DefaultJSONStructConverter();", "type": "DefaultJSONStructConverter", "var_name": "converter" },...
{ "body": "@Override\n protected RecordsIterable<TypedStruct> apply(final FilterContext context, final TypedStruct record) {\n final String value = extractJsonField(checkIsNotNull(record.get(configs.source())));\n final TypedValue typedValue;\n\n try {\n typedValue = converter.readJ...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_0
{ "fields": [ { "declarator": "context = new StandardEvaluationContext(new Object())", "modifier": "private", "original_string": "private StandardEvaluationContext context = new StandardEvaluationContext(new Object());", "type": "StandardEvaluationContext", "var_name": "context" ...
{ "body": "@Test(expected = AccessException.class)\n public void should_thrown_when_writing_invalid_property_using_getter_method_given_pojo() {\n ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor();\n accessor.write(context, new DummyObject(\"foo\"), \"unknown\", \"\");\n }", ...
{ "fields": [ { "declarator": "GETTER_PREFIX = \"get\"", "modifier": "private static final", "original_string": "private static final String GETTER_PREFIX = \"get\";", "type": "String", "var_name": "GETTER_PREFIX" }, { "declarator": "SETTER_PREFIX = \"set\"", "mod...
{ "body": "@Override\n public void write(final EvaluationContext context,\n final Object target,\n final String name,\n final Object newValue) throws AccessException {\n Objects.requireNonNull(target, \"target cannot be null\");\n Objects...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_76
{ "fields": [], "file": "connect-file-pulse-api/src/test/java/io/streamthoughts/kafka/connect/filepulse/source/internal/ConnectSchemaMapperTest.java", "identifier": "ConnectSchemaMapperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n @SuppressWarnings(\"unchecked\")\n public void shouldMapGivenTypeStructWithArrayField() {\n TypedStruct struct = TypedStruct.create()\n .put(\"field1\", Collections.singletonList(\"value\"));\n\n SchemaAndValue schemaAndValue = struct.schema().map(ConnectSchemaMap...
{ "fields": [ { "declarator": "DEFAULT_NULL_VALUE = null", "modifier": "private static final", "original_string": "private static final Object DEFAULT_NULL_VALUE = null;", "type": "Object", "var_name": "DEFAULT_NULL_VALUE" }, { "declarator": "INSTANCE = new ConnectSchem...
{ "body": "@Override\n public Schema map(final MapSchema schema) {\n final Schema keySchema = schema.keySchema().map(this);\n final Schema valueSchema = schema.valueSchema().map(this);\n return asNullableAndOptional(SchemaBuilder.map(keySchema, valueSchema)).build();\n }", "class_method_s...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_21
{ "fields": [], "file": "connect-file-pulse-expression/src/test/java/io/streamthoughts/kafka/connect/filepulse/expression/parser/antlr4/Antlr4ExpressionParserTest.java", "identifier": "Antlr4ExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_parse_function_expression_given_nested_function_with_multiple_args() {\n final String strExpression = \"{{ lowercase( extract_array($.values,0) ) }}\";\n Expression expression = new Antlr4ExpressionParser().parseExpression(strExpression);\n\n assertFunctio...
{ "fields": [ { "declarator": "DEFAULT_ROOT_OBJECT = \"value\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_ROOT_OBJECT = \"value\";", "type": "String", "var_name": "DEFAULT_ROOT_OBJECT" } ], "file": "connect-file-pulse-express...
{ "body": "@Override\n public Expression parseExpression(final String expression) throws ExpressionException {\n return parseExpression(expression, DEFAULT_ROOT_OBJECT);\n }", "class_method_signature": "Antlr4ExpressionParser.parseExpression(final String expression)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_37
{ "fields": [ { "declarator": "metadata = new SourceMetadata(\n \"test\",\n \"/tmp/path\",\n 0L,\n 123L,\n 456L,\n 789L\n )", "modifier": "private static final", "original_string": "private static final SourceMetadata metadata ...
{ "body": "@Test\n public void should_get_composed_offset_based_on_path_and_hash() {\n Map<String, Object> result = new ComposeOffsetStrategy(\"PATH+HASH\").toPartitionMap(metadata);\n Assert.assertEquals(2, result.size());\n Assert.assertEquals(\"/tmp/path\", result.get(\"path\"));\n A...
{ "fields": [ { "declarator": "FILEPATH_FIELD = \"path\"", "modifier": "private static final", "original_string": "private static final String FILEPATH_FIELD = \"path\";", "type": "String", "var_name": "FILEPATH_FIELD" }, { "declarator": "FILENAME_FIELD = \"name\"", ...
{ "body": "@Override\n public Map<String, Object> toPartitionMap(final SourceMetadata metadata) {\n Map<String, Object> offset = new LinkedHashMap<>();\n for (GenericOffsetStrategy strategy : strategies) {\n strategy.addAttributeToPartitionMap(metadata, offset);\n }\n return ...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_60
{ "fields": [ { "declarator": "compiler", "modifier": "private", "original_string": "private GrokPatternCompiler compiler;", "type": "GrokPatternCompiler", "var_name": "compiler" } ], "file": "connect-file-pulse-filters/src/test/java/io/streamthoughts/kafka/connect/filepulse/...
{ "body": "@Test\n public void shouldCompileMatcherGivenMultipleGrokPatternWithSemantic() {\n final GrokMatcher matcher = compiler.compile(\"%{ISO8601_TIMEZONE:timezone}\");\n Assert.assertNotNull(matcher);\n Assert.assertEquals(\"ISO8601_TIMEZONE\", matcher.getGrokPattern(0).syntax());\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(GrokPatternCompiler.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(GrokPatternCompiler.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "public GrokMatcher compile(final String expression) {\n Objects.requireNonNull(expression, \"expression can't be null\");\n\n LOG.info(\"Starting to compile grok matcher expression : {}\", expression);\n ArrayList<GrokPattern> patterns = new ArrayList<>();\n final String regex =...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }
170883666_61
{ "fields": [ { "declarator": "compiler", "modifier": "private", "original_string": "private GrokPatternCompiler compiler;", "type": "GrokPatternCompiler", "var_name": "compiler" } ], "file": "connect-file-pulse-filters/src/test/java/io/streamthoughts/kafka/connect/filepulse/...
{ "body": "@Test\n public void shouldCompileMatcherGivenMultipleGrokPatternWithSemanticAndType() {\n final GrokMatcher matcher = compiler.compile(\"%{ISO8601_TIMEZONE:timezone:integer}\");\n Assert.assertNotNull(matcher);\n Assert.assertEquals(\"ISO8601_TIMEZONE\", matcher.getGrokPattern(0).sy...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(GrokPatternCompiler.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(GrokPatternCompiler.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "public GrokMatcher compile(final String expression) {\n Objects.requireNonNull(expression, \"expression can't be null\");\n\n LOG.info(\"Starting to compile grok matcher expression : {}\", expression);\n ArrayList<GrokPattern> patterns = new ArrayList<>();\n final String regex =...
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 170883666, "size": 2776, "stargazer_count": 26, "stars": null, "updates": null, "url": "https://github.com/streamthoughts/kafka-connect-file-pulse" }