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