/*
- * Sone - DefaultIdentity.java - Copyright © 2010–2019 David Roden
+ * Sone - DefaultIdentity.kt - Copyright © 2010–2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/**
* A Web of Trust identity.
*/
-open class DefaultIdentity(private val id: String, private val nickname: String, private val requestUri: String) : Identity {
+open class DefaultIdentity(private val id: String, private val nickname: String?, private val requestUri: String) : Identity {
private val contexts = mutableSetOf<String>().synchronized()
private val properties = mutableMapOf<String, String>().synchronized()
override fun hasContext(context: String) = context in contexts
- override fun setContexts(contexts: Collection<String>) {
+ override fun setContexts(contexts: Set<String>) {
synchronized(this.contexts) {
this.contexts.clear()
this.contexts.addAll(contexts)