/**
 * © David Attias 2015
 */
package io.spacedog.client.data;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.spacedog.client.credentials.ObjectRolePermissions;
import io.spacedog.client.credentials.Permission;
import io.spacedog.client.credentials.Roles;
import io.spacedog.client.push.Installation;
import io.spacedog.client.settings.Settings;
import io.spacedog.client.settings.SettingsBase;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonAutoDetect(fieldVisibility = Visibility.ANY, //
		getterVisibility = Visibility.NONE, //
		isGetterVisibility = Visibility.NONE, //
		setterVisibility = Visibility.NONE)
public class DataSettings implements Settings {

	// putain de merde

	@JsonIgnore
	private long version = MATCH_ANY_VERSIONS;
	private ObjectRolePermissions acl = new ObjectRolePermissions();

	public DataSettings() {
		acl.put(Installation.TYPE, Roles.user, Permission.create, Permission.readMine, //
				Permission.updateMine, Permission.deleteMine);
	}

	@Override
	@JsonIgnore
	public long version() {
		return version;
	}

	@Override
	public void version(long version) {
		this.version = version;
	}

	public ObjectRolePermissions acl() {
		return acl;
	}

	public void acl(ObjectRolePermissions acl) {
		this.acl = acl;
	}

	@Override
	@JsonIgnore
	public String id() {
		return SettingsBase.id(getClass());
	}
}

@@ -231,16 +231,26 @@
 onIgnore
+Properties
 ;%0Aimport
@@ -258,56 +258,33 @@
 com.
-fasterxml.jackson.annotation.JsonIgnorePropertie
+google.common.base.Object
 s;%0A%0A
@@ -488,53 +488,8 @@
 on;%0A
-import io.spacedog.client.settings.Settings;%0A
 impo
@@ -783,17 +783,14 @@
 ngs 
-implement
+extend
 s Se
@@ -799,89 +799,15 @@
 ings
- %7B%0A%0A%09// putain de merde%0A%0A%09@JsonIgnore%0A%09private long version = MATCH_ANY_VERSIONS;
+Base %7B%0A
 %0A%09pr
@@ -1039,361 +1039,328 @@
 %7D%0A%0A%09
-@Override%0A%09@JsonIgnore%0A%09public long version() %7B%0A%09%09return version;%0A%09%7D%0A%0A%09@Override%0A%09public void version(long version) %7B%0A%09%09this.version = version;%0A%09%7D%0A%0A%09public ObjectRolePermissions acl() %7B%0A%09%09return acl;%0A%09%7D%0A%0A%09public void acl(ObjectRolePermissions acl) %7B%0A%09%09this.acl = acl;%0A%09%7D%0A%0A%09@Override%0A%09@JsonIgnore%0A%09public String id() %7B%0A%09%09return SettingsBase.id(getClass()
+public ObjectRolePermissions acl() %7B%0A%09%09return acl;%0A%09%7D%0A%0A%09public void acl(ObjectRolePermissions acl) %7B%0A%09%09this.acl = acl;%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(Object obj) %7B%0A%09%09if (obj == null)%0A%09%09%09return false;%0A%09%09if (obj instanceof DataSettings == false)%0A%09%09%09return false;%0A%09%09return Objects.equal(acl, ((DataSettings) obj).acl
 );%0A%09

Add equals method to DataSettings