001    /*
002     * Copyright (C) 2014 XStream Committers.
003     * All rights reserved.
004     *
005     * Created on 08. January 2014 by Joerg Schaible
006     */
007    package com.thoughtworks.xstream.security;
008    
009    /**
010     * Permission for any type and <code>null</code>.
011     * 
012     * @author J&ouml;rg Schaible
013     * @since 1.4.7
014     */
015    public class AnyTypePermission implements TypePermission {
016        /**
017         * @since 1.4.7
018         */
019        public static final TypePermission ANY = new AnyTypePermission();
020    
021        public boolean allows(Class type) {
022            return true;
023        }
024    
025        public int hashCode() {
026            return 3;
027        }
028    
029        public boolean equals(Object obj) {
030            return obj != null && obj.getClass() == AnyTypePermission.class;
031        }
032    }