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