package sizebay.catalog.client.model.filters;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ProductFilter extends Filter {

	private String page;
	private String id;
	private String name;
	private String permalink;
	private String ageGroup;
	private String feedAgeGroup;
	private String gender;
	private String feedGender;
	private String feedProductId;
	private String brandId;
	private String brandName;
	private String feedBrandId;
	private String feedBrandName;
	private String categoryId;
	private String categoryName;
	private String modelingId;
	private String modelingName;
	private String sizeType;
	private String modelingSizeType;
	private String strongBrandId;
	private String strongBrandName;
	private String strongCategoryType;
	private String strongCategoryId;
	private String strongCategoryName;
	private String strongSubcategoryId;
	private String strongSubcategoryName;
	private String strongModelId;
	private String strongModelName;
	private String slugId;
	private String onlyShoes;
	private String status;
	private String productsThatShouldBeFixed;
	private String productsAvailable;
	private String productsAvailableWithError;

	public ProductFilter setPermalink(String permalink) {
		this.permalink = URLEncoder.encode(permalink, StandardCharsets.UTF_8);
		return this;
	}

	public String getDecodePermalink() {
		return URLDecoder.decode(this.permalink, StandardCharsets.UTF_8);
	}
}

package sizebay.catalog.client.model.filters;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ProductFilter extends Filter {

	private String page;
	private String id;
	private String name;
	private String permalink;
	private String ageGroup;
	private String feedAgeGroup;
	private String gender;
	private String feedGender;
	private String feedProductId;
	private String brandId;
	private String brandName;
	private String feedBrandId;
	private String feedBrandName;
	private String categoryId;
	private String categoryName;
	private String modelingId;
	private String modelingName;
	private String sizeType;
	private String modelingSizeType;
	private String strongBrandId;
	private String strongBrandName;
	private String strongCategoryType;
	private String strongCategoryId;
	private String strongCategoryName;
	private String strongSubcategoryId;
	private String strongSubcategoryName;
	private String strongModelId;
	private String strongModelName;
	private String slugId;
	private String onlyShoes;
	private String status;
	private String productsThatShouldBeFixed;
	private String productsAvailable;
	private String productsAvailableWithError;
	public ProductFilter setPermalink(String permalink) {
		this.permalink = permalink != null ? URLEncoder.encode(permalink, StandardCharsets.UTF_8) : null;
		return this;
	}

	public String decodePermalink() {
		return permalink != null ? URLDecoder.decode(this.permalink, StandardCharsets.UTF_8) : null;
	}
}

rename decode method