/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */

package net.ranides.assira.reflection.mockup;

import net.ranides.assira.annotations.Meta;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class ForConstructor {
    
    public static class ARecord {
        
        int x;
        int y;
        
        public ARecord() {
            // do nothing
        }

        public ARecord(int x, int y) {
            this.x = x;
            this.y = y;
        }
        
    }

    public static class Record extends ARecord {
        
        int z;
        
        public Record() {
            // do nothing
        }
        
        public Record(String param) {
            String[] params = param.split(",");
            this.x = Integer.parseInt(params[0]);
            this.y = Integer.parseInt(params[1]);
            this.z = Integer.parseInt(params[2]);
        }

        public Record(int x, int y, int z) {
            super(x, y);
            this.z = z;
        }
        
        @Meta.Unsafe
        @Deprecated
        public <R extends Number> Record(R param1, R param2) {
            this.x  = param1.intValue();
            this.y  = param2.intValue();
            this.z  = x + y; 
        }
        
        
        @Override
        public String toString() {
            return "Record{" + x + ":" + y + ":" + z + '}';
        }
        
    }
    
}
