Guava ImmutableSet - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava ImmutableSet class.

This code example shows how to use the following methods:hashCode, isEmpty
 
    @Override 
    public int hashCode() { 
        int result = path != null ? path.hashCode() : 0;
        result = 31 * result + (directory ? 1 : 0);
        if (subEntries.isEmpty()) {
            result = 31 * result + (int) (size ^ (size >>> 32));
            result = 31 * result + (int) (crc ^ (crc >>> 32));
        } 
        result = 31 * result + subEntries.hashCode();
        return result;
    } 
 
    @Override 
    public String toString() {
        return "ArchiveEntry{" 
                + ", path='" + path + '\''
                + ", directory=" + directory
                + ", size=" + size
                + ", crc=" + crc
6
CodeRank
This code example shows how to use the following methods:equals
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
 
            Deadlock deadlock = (Deadlock) o;
 
            if (memberIds != null ? !memberIds.equals(deadlock.memberIds) : deadlock.memberIds != null) return false;
 
            return true; 
        } 
 
        @Override 
        public int hashCode() { 
            int result = members != null ? Arrays.hashCode(members) : 0;
            result = 31 * result + (description != null ? description.hashCode() : 0);
            result = 31 * result + (memberIds != null ? memberIds.hashCode() : 0);
            return result;
        } 
 
        @Override 
        public String toString() {
6
CodeRank
This code example shows how to use the following methods:contains
        this.warnOnRmiStubs = warnOnRmiStubs;
    } 
 
    @Override 
    protected boolean excludeFromAntProperties(String fieldName) {
        return EXCLUDE_FROM_ANT_PROPERTIES.contains(fieldName);
    } 
} 
5
CodeRank
This code example shows how to use the following methods:contains
        return this; 
    } 
 
    @Override 
    protected boolean excludeFromAntProperties(String fieldName) { 
        return EXCLUDE_FROM_ANT_PROPERTIES.contains(fieldName); 
    } 
 
    /** 
     * Internal method. 
     */ 
    public Map<String, Object> optionMap() { 
        Map<String, Object> map = super.optionMap(); 
        map.putAll(forkOptions.optionMap()); 
        if (optimizationOptions.containsKey("indy")) { 
            map.put("indy", optimizationOptions.get("indy")); 
        } 
        return map; 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:contains
        return map; 
    } 
 
    @Override 
    protected boolean excludeFromAntProperties(String fieldName) {
        return EXCLUDE_FROM_ANT_PROPERTIES.contains(fieldName);
    } 
 
    @Override 
    protected String getAntPropertyName(String fieldName) {
        if (fieldName.equals("warnings")) {
            return "nowarn"; 
        } 
        if (fieldName.equals("extensionDirs")) {
            return "extdirs"; 
        } 
        return fieldName;
    } 
 
    @Override 
4
CodeRank
This code example shows how to use the following methods:contains
    } 
 
    private static class DefaultStringMatchingStrategy implements StringMatchingStrategy { 
        @Override 
        public boolean containsMatch(ImmutableSet<String> matchExpressions, String metricName) {
            return matchExpressions.contains(metricName);
        } 
    } 
 
    private static class RegexStringMatchingStrategy implements StringMatchingStrategy { 
        private final LoadingCache<String, Pattern> patternCache;
 
        private RegexStringMatchingStrategy() { 
            patternCache = CacheBuilder.newBuilder()
                    .expireAfterWrite(1, TimeUnit.HOURS)
                    .build(new CacheLoader<String, Pattern>() {
                        @Override 
                        public Pattern load(String regex) throws Exception {
                            return Pattern.compile(regex);
                        } 
4
CodeRank
See Code Examples for Guava ImmutableSet Methods: