001/*
002 * Trident - A Multithreaded Server Alternative
003 * Copyright 2014 The TridentSDK Team
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package net.tridentsdk.meta.component;
018
019import net.tridentsdk.base.Substance;
020
021import javax.annotation.concurrent.ThreadSafe;
022
023/**
024 * Provides a marker class which represents an illegal type metadata
025 *
026 * @author The TridentSDK Team
027 * @since 0.4-alpha
028 */
029@ThreadSafe
030public interface IllegalMeta<T> extends Meta<T> {
031    /**
032     * Create a new illegal meta value
033     *
034     * @param <T> the meta type
035     * @return the new illegal meta
036     */
037    static <T> IllegalMeta<T> newMeta() {
038        return new IllegalMeta<T>() {
039        };
040    }
041
042    @Override
043    default Meta<T> decodeMeta(T instance, byte[] data) {
044        return null;
045    }
046
047    @Override
048    default byte[] encodeMeta() {
049        return new byte[0];
050    }
051
052    @Override
053    default Meta<T> make() {
054        return null;
055    }
056
057    @Override
058    default Substance[] applyTo(MetaCollection collection) {
059        return new Substance[0];
060    }
061}