@sealed
@classDecorator
class Greeter {
    @format("Hello, %s")
    greeting: string

    constructor(message: string) {
        this.greeting = message
    }

    @validate
    greet(@required name: string) {
        return "Hello " + name + ", " + this.greeting
    }
}

class Point {
    private _x: number
    private _y: number
    constructor(@inject x: number, @inject('yNumber') y: number) {
        this._x = x
        this._y = y
    }

    @configurable(false)
    get x() { return this._x }

    @configurable(false)
    get y() { return this._y }
}

class Line {
    private _p0: Point
    private _p1: Point

    @validate
    @Reflect.metadata("design:type", Point)
    set p0(value: Point) { this._p0 = value }
    get p0() { return this._p0 }

    @validate
    @Reflect.metadata("design:type", Point)
    set p1(value: Point) { this._p1 = value }
    get p1() { return this._p1 }
}
