test_class.declarator: cacheKeyBuilder
test_class.modifier: private static
test_class.original_string: private static CacheKeyBuilderImpl cacheKeyBuilder;
test_class.type: CacheKeyBuilderImpl
test_class.var_name: cacheKeyBuilder
test_class.file: simple-spring-memcached/src/test/java/com/google/code/ssm/aop/support/CacheKeyBuilderImplTest.java
test_class.identifier: CacheKeyBuilderImplTest
test_case.body: @Test
      public void getAssignCacheKey() {
          AnnotationData data = new AnnotationData();
          try {
              data.setAssignedKey(null);
              data.setNamespace(null);
              cacheKeyBuilder.getAssignCacheKey(data);
              fail("Expected exception.");
          } catch (InvalidParameterException ex) {
              assertTrue(ex.getMessage().indexOf("at least 1 character") != -1);
              System.out.println(ex.getMessage());
          }
  
          try {
              data.setAssignedKey("");
              cacheKeyBuilder.getAssignCacheKey(data);
              fail("Expected exception.");
          } catch (InvalidParameterException ex) {
              assertTrue(ex.getMessage().indexOf("at least 1 character") != -1);
              System.out.println(ex.getMessage());
          }
  
          final String objectId = RandomStringUtils.randomAlphanumeric(20);
          final String namespace = RandomStringUtils.randomAlphanumeric(12);
  
          data.setAssignedKey(objectId);
          data.setNamespace(namespace);
          final String result = cacheKeyBuilder.getAssignCacheKey(data);
  
          assertTrue(result.indexOf(objectId) != -1);
          assertTrue(result.indexOf(namespace) != -1);
      }
test_case.class_method_signature: CacheKeyBuilderImplTest.getAssignCacheKey()
test_case.full_signature: @Test public void getAssignCacheKey()
test_case.identifier: getAssignCacheKey
test_case.invocations: setAssignedKey setNamespace getAssignCacheKey fail assertTrue indexOf getMessage println getMessage setAssignedKey getAssignCacheKey fail assertTrue indexOf getMessage println getMessage randomAlphanumeric randomAlphanumeric setAssignedKey setNamespace getAssignCacheKey assertTrue indexOf assertTrue indexOf
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getAssignCacheKey()
focal_class.declarator: SEPARATOR = ":"
focal_class.modifier: private static final
focal_class.original_string: private static final String SEPARATOR = ":";
focal_class.type: String
focal_class.var_name: SEPARATOR
focal_class.declarator: ID_SEPARATOR = "/"
focal_class.modifier: private static final
focal_class.original_string: private static final String ID_SEPARATOR = "/";
focal_class.type: String
focal_class.var_name: ID_SEPARATOR
focal_class.declarator: defaultKeyProvider = new DefaultKeyProvider()
focal_class.modifier: private
focal_class.original_string: private KeyProvider defaultKeyProvider = new DefaultKeyProvider();
focal_class.type: KeyProvider
focal_class.var_name: defaultKeyProvider
focal_class.file: simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/CacheKeyBuilderImpl.java
focal_class.identifier: CacheKeyBuilderImpl
focal_class.interfaces: implements CacheKeyBuilder
focal_class.class_method_signature: CacheKeyBuilderImpl.setDefaultKeyProvider(final KeyProvider defaultKeyProvider)
focal_class.full_signature: public void setDefaultKeyProvider(final KeyProvider defaultKeyProvider)
focal_class.identifier: setDefaultKeyProvider
focal_class.modifiers: public
focal_class.parameters: (final KeyProvider defaultKeyProvider)
focal_class.return: void
focal_class.signature: void setDefaultKeyProvider(final KeyProvider defaultKeyProvider)
focal_class.class_method_signature: CacheKeyBuilderImpl.getDefaultKeyProvider()
focal_class.full_signature: public KeyProvider getDefaultKeyProvider()
focal_class.identifier: getDefaultKeyProvider
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: KeyProvider
focal_class.signature: KeyProvider getDefaultKeyProvider()
focal_class.class_method_signature: CacheKeyBuilderImpl.getCacheKey(final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.full_signature: @Override public String getCacheKey(final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.identifier: getCacheKey
focal_class.modifiers: @Override public
focal_class.parameters: (final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.return: String
focal_class.signature: String getCacheKey(final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.class_method_signature: CacheKeyBuilderImpl.getCacheKey(final Object keyObject, final String namespace)
focal_class.full_signature: @Override public String getCacheKey(final Object keyObject, final String namespace)
focal_class.identifier: getCacheKey
focal_class.modifiers: @Override public
focal_class.parameters: (final Object keyObject, final String namespace)
focal_class.return: String
focal_class.signature: String getCacheKey(final Object keyObject, final String namespace)
focal_class.class_method_signature: CacheKeyBuilderImpl.getCacheKeys(final List<Object> keyObjects, final String namespace)
focal_class.full_signature: @Override public List<String> getCacheKeys(final List<Object> keyObjects, final String namespace)
focal_class.identifier: getCacheKeys
focal_class.modifiers: @Override public
focal_class.parameters: (final List<Object> keyObjects, final String namespace)
focal_class.return: List<String>
focal_class.signature: List<String> getCacheKeys(final List<Object> keyObjects, final String namespace)
focal_class.class_method_signature: CacheKeyBuilderImpl.getCacheKeys(final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.full_signature: @Override public List<String> getCacheKeys(final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.identifier: getCacheKeys
focal_class.modifiers: @Override public
focal_class.parameters: (final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.return: List<String>
focal_class.signature: List<String> getCacheKeys(final AnnotationData data, final Object[] args, final String methodDesc)
focal_class.class_method_signature: CacheKeyBuilderImpl.getAssignCacheKey(final AnnotationData data)
focal_class.full_signature: @Override public String getAssignCacheKey(final AnnotationData data)
focal_class.identifier: getAssignCacheKey
focal_class.modifiers: @Override public
focal_class.parameters: (final AnnotationData data)
focal_class.return: String
focal_class.signature: String getAssignCacheKey(final AnnotationData data)
focal_class.class_method_signature: CacheKeyBuilderImpl.getCacheKey(final Object[] keyObjects, final String namespace)
focal_class.full_signature: private String getCacheKey(final Object[] keyObjects, final String namespace)
focal_class.identifier: getCacheKey
focal_class.modifiers: private
focal_class.parameters: (final Object[] keyObjects, final String namespace)
focal_class.return: String
focal_class.signature: String getCacheKey(final Object[] keyObjects, final String namespace)
focal_class.class_method_signature: CacheKeyBuilderImpl.buildCacheKey(final String[] objectIds, final String namespace)
focal_class.full_signature: private String buildCacheKey(final String[] objectIds, final String namespace)
focal_class.identifier: buildCacheKey
focal_class.modifiers: private
focal_class.parameters: (final String[] objectIds, final String namespace)
focal_class.return: String
focal_class.signature: String buildCacheKey(final String[] objectIds, final String namespace)
focal_class.class_method_signature: CacheKeyBuilderImpl.checkKeyPart(final String keyPart)
focal_class.full_signature: private void checkKeyPart(final String keyPart)
focal_class.identifier: checkKeyPart
focal_class.modifiers: private
focal_class.parameters: (final String keyPart)
focal_class.return: void
focal_class.signature: void checkKeyPart(final String keyPart)
focal_method.body: @Override
      public String getAssignCacheKey(final AnnotationData data) {
          if (data == null || data.getAssignedKey() == null || data.getAssignedKey().length() < 1) {
              throw new InvalidParameterException("Ids for objects in the cache must be at least 1 character long.");
          }
          return data.getNamespace() + SEPARATOR + data.getAssignedKey();
      }
focal_method.class_method_signature: CacheKeyBuilderImpl.getAssignCacheKey(final AnnotationData data)
focal_method.full_signature: @Override public String getAssignCacheKey(final AnnotationData data)
focal_method.identifier: getAssignCacheKey
focal_method.invocations: getAssignedKey length getAssignedKey getNamespace getAssignedKey
focal_method.modifiers: @Override public
focal_method.parameters: (final AnnotationData data)
focal_method.return: String
focal_method.signature: String getAssignCacheKey(final AnnotationData data)