@Test public void testServiceInfo() throws Exception { testServiceInfo( "/users", "users.UsersService" ); testServiceInfo( "/usersmessagesgroups:group", "users.groups.GroupsService" ); testServiceInfo( "/userslikes:barcomments", "blogpack.posts.comments.CommentsService" ); testServiceInfo( "/blogpack.posts/*/comments:blogpost.comment", "blogpack.posts.comments.CommentsService" ); }
public ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName, String itemType, List<String> patterns, List<String> collections ) { this.name = name; this.rootService = rootService; this.rootType = rootType; this.containerType = containerType; this.collectionName = collectionName; this.itemType = itemType; this.patterns = patterns; this.collections = collections; Hasher hasher = Hashing.md5().newHasher(); for ( String pattern : patterns ) { hasher.putString( pattern, UTF_8 ); } hashCode = hasher.hash().asInt(); }
ServiceInfo { public ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName, String itemType, List<String> patterns, List<String> collections ) { this.name = name; this.rootService = rootService; this.rootType = rootType; this.containerType = containerType; this.collectionName = collectionName; this.itemType = itemType; this.patterns = patterns; this.collections = collections; Hasher hasher = Hashing.md5().newHasher(); for ( String pattern : patterns ) { hasher.putString( pattern, UTF_8 ); } hashCode = hasher.hash().asInt(); } }
ServiceInfo { public ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName, String itemType, List<String> patterns, List<String> collections ) { this.name = name; this.rootService = rootService; this.rootType = rootType; this.containerType = containerType; this.collectionName = collectionName; this.itemType = itemType; this.patterns = patterns; this.collections = collections; Hasher hasher = Hashing.md5().newHasher(); for ( String pattern : patterns ) { hasher.putString( pattern, UTF_8 ); } hashCode = hasher.hash().asInt(); } ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName,
                        String itemType, List<String> patterns, List<String> collections ); }
ServiceInfo { public ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName, String itemType, List<String> patterns, List<String> collections ) { this.name = name; this.rootService = rootService; this.rootType = rootType; this.containerType = containerType; this.collectionName = collectionName; this.itemType = itemType; this.patterns = patterns; this.collections = collections; Hasher hasher = Hashing.md5().newHasher(); for ( String pattern : patterns ) { hasher.putString( pattern, UTF_8 ); } hashCode = hasher.hash().asInt(); } ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName,
                        String itemType, List<String> patterns, List<String> collections ); static String normalizeServicePattern( String s ); static List<String> getPatterns( String servicePattern ); static List<String> getPatterns( String servicePattern, String[] collections ); static String determineType( String servicePattern ); static String getClassName( String servicePattern ); static ServiceInfo getServiceInfo( String servicePattern ); String getClassName(); String getName(); boolean isRootService(); String getRootType(); boolean isGenericRootType(); String getContainerType(); boolean isContainerType(); String getCollectionName(); String getItemType(); boolean isGenericItemType(); List<String> getPatterns(); List<String> getCollections(); @Override boolean equals( Object obj ); @Override int hashCode(); }
ServiceInfo { public ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName, String itemType, List<String> patterns, List<String> collections ) { this.name = name; this.rootService = rootService; this.rootType = rootType; this.containerType = containerType; this.collectionName = collectionName; this.itemType = itemType; this.patterns = patterns; this.collections = collections; Hasher hasher = Hashing.md5().newHasher(); for ( String pattern : patterns ) { hasher.putString( pattern, UTF_8 ); } hashCode = hasher.hash().asInt(); } ServiceInfo( String name, boolean rootService, String rootType, String containerType, String collectionName,
                        String itemType, List<String> patterns, List<String> collections ); static String normalizeServicePattern( String s ); static List<String> getPatterns( String servicePattern ); static List<String> getPatterns( String servicePattern, String[] collections ); static String determineType( String servicePattern ); static String getClassName( String servicePattern ); static ServiceInfo getServiceInfo( String servicePattern ); String getClassName(); String getName(); boolean isRootService(); String getRootType(); boolean isGenericRootType(); String getContainerType(); boolean isContainerType(); String getCollectionName(); String getItemType(); boolean isGenericItemType(); List<String> getPatterns(); List<String> getCollections(); @Override boolean equals( Object obj ); @Override int hashCode(); static final Charset UTF_8; }