package org.oskari.print.request;

public class PrintLayer {

    private int id;
    private String type;
    private String url;
    private String name;
    private String style;
    private String srsName;
    private String version;
    private int opacity;
    private String username;
    private String password;
    private PrintTile[] tiles;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getOpacity() {
        return opacity;
    }

    public void setOpacity(int opacity) {
        this.opacity = opacity;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public PrintTile[] getTiles() {
        return tiles;
    }

    public void setTiles(PrintTile[] tiles) {
        this.tiles = tiles;
    }

    public String getSrsName() {
        return srsName;
    }

    public void setSrsName(String srsName) {
        this.srsName = srsName;
    }

}

@@ -32,181 +32,194 @@
 t;%0A%0A
-public class PrintLayer %7B%0A%0A    private int id;%0A    private String type;%0A    private String url;%0A    private String name;%0A    private String style;%0A    private String srsName
+import java.util.Optional;%0A%0Aimport org.oskari.service.user.UserLayerService;%0A%0Aimport fi.nls.oskari.domain.map.OskariLayer;%0A%0Apublic class PrintLayer %7B%0A%0A    private OskariLayer oskariLayer
 ;%0A  
@@ -235,23 +235,21 @@
  String 
-version
+style
 ;%0A    pr
@@ -283,52 +283,44 @@
 ate 
-String username;%0A    private String pa
+Optional%3CUserLayerService%3E proce
 ss
-w
 or
-d
 ;%0A  
@@ -364,100 +364,93 @@
 lic 
-int getId() %7B%0A        return id;%0A    %7D%0A%0A    public void setId(int id) %7B%0A        this.id = id
+void setOskariLayer(OskariLayer oskariLayer) %7B%0A        this.oskariLayer = oskariLayer
 ;%0A  
@@ -469,22 +469,17 @@
 lic 
-Str
 in
-g
+t
  get
-Type
+Id
 () %7B
@@ -494,20 +494,35 @@
  return 
-type
+oskariLayer.getId()
 ;%0A    %7D%0A
@@ -537,32 +537,23 @@
 lic 
-void setType(
 String 
-t
+getT
 ype
+(
 ) %7B%0A
@@ -564,24 +564,36 @@
     
-this.type = t
+return oskariLayer.getT
 ype
+()
 ;%0A  
@@ -646,84 +646,29 @@
 urn 
-name;%0A    %7D%0A%0A    public void setName(String name) %7B%0A        this.name = n
+oskariLayer.getN
 ame
+()
 ;%0A  
@@ -720,79 +720,28 @@
 urn 
-url;%0A    %7D%0A%0A    public void setUrl(String url) %7B%0A        this.url = url
+oskariLayer.getUrl()
 ;%0A  
@@ -792,24 +792,65 @@
 return style
+ != null ? style : oskariLayer.getStyle()
 ;%0A    %7D%0A%0A   
@@ -974,99 +974,32 @@
 urn 
-version;%0A    %7D%0A%0A    public void setVersion(String version) %7B%0A        this.version = version
+oskariLayer.getVersion()
 ;%0A  
@@ -1198,258 +1198,116 @@
 urn 
-username;%0A    %7D%0A%0A    public void setUsername(String username) %7B%0A        this.username = username;%0A    %7D%0A%0A    public String getPassword() %7B%0A        return password;%0A    %7D%0A%0A    public void setPassword(String password) %7B%0A        this.password = password
+oskariLayer.getUsername();%0A    %7D%0A%0A    public String getPassword() %7B%0A        return oskariLayer.getPassword()
 ;%0A  
@@ -1472,25 +1472,47 @@
 lic 
-String getSrsName
+Optional%3CUserLayerService%3E getProcessor
 () %7B
@@ -1527,23 +1527,25 @@
  return 
-srsName
+processor
 ;%0A    %7D%0A
@@ -1568,64 +1568,92 @@
  set
-SrsName(String srsName) %7B%0A        this.srsName = srsName
+Processor(Optional%3CUserLayerService%3E processor) %7B%0A        this.processor = processor
 ;%0A  

Refactor PrintLayer