# PropertyMetadata Class

Module
import { PropertyMetadata } from "@tsed/common"
Source/packages/common/src/mvc/models/PropertyMetadata.ts

# Overview

class PropertyMetadata extends Storable implements IPropertyOptions {
    /**
     * Allowed value when the entity is required.
     * @type {Array}
     */
    allowedRequiredValues: any[];
    ignoreProperty: boolean;
    onSerialize: Function;
    onDeserialize: Function;
    constructor(target: any, propertyKey: any);
    /**
     *
     * @returns {Type<any>}
     */
    get type(): Type<any>;
    /**
     *
     * @param value
     */
    set type(value: Type<any>);
    /**
     *
     * @returns {JsonSchema}
     */
    get schema(): JsonSchema;
    /**
     * Return the required state.
     * @returns {boolean}
     */
    get required(): boolean;
    /**
     * Change the state of the required data.
     * @param value
     */
    set required(value: boolean);
    /**
     *
     * @param target
     * @param propertyKey
     * @returns {PropertyMetadata}
     */
    static get(target: Type<any>, propertyKey: string | symbol): PropertyMetadata;
    /**
     *
     * @param target
     * @param options
     * @returns {Array}
     */
    static getProperties(target: Type<any>, options?: Partial<{
        withIgnoredProps: boolean;
    }>): Map<string | symbol, PropertyMetadata>;
    /**
     *
     * @param {Type<any>} target
     * @returns {Map<string | symbol, PropertyMetadata>}
     */
    static getOwnProperties(target: Type<any>): Map<string | symbol, PropertyMetadata>;
    /**
     *
     * @param target
     * @param propertyKey
     * @param property
     */
    static set(target: Type<any>, propertyKey: string | symbol, property: PropertyMetadata): void;

}