1 /*
2  * Copyright (C) 2014 XStream Committers.
3  * All rights reserved.
4  *
5  * Created on 08. January 2014 by Joerg Schaible
6  */

7 package com.thoughtworks.xstream.security;
8
9 /**
10  * Permission for any type and <code>null</code>.
11  * 
12  * @author J&ouml;rg Schaible
13  * @since 1.4.7
14  */

15 public class AnyTypePermission implements TypePermission {
16     /**
17      * @since 1.4.7
18      */

19     public static final TypePermission ANY = new AnyTypePermission();
20
21     public boolean allows(Class type) {
22         return true;
23     }
24
25     public int hashCode() {
26         return 3;
27     }
28
29     public boolean equals(Object obj) {
30         return obj != null && obj.getClass() == AnyTypePermission.class;
31     }
32 }
33