import typing

import java
import java.chaquopy
import java.io
import java.lang
import java.util

class AbstractPreferences(Preferences):
    lock: java.lang.Object = ...
    newNode: bool = ...
    def __init__(self, parent: AbstractPreferences, name: str | java.lang.String, /) -> None: ...
    def absolutePath(self) -> str: ...
    def addNodeChangeListener(self, ncl: NodeChangeListener, /) -> None: ...
    def addPreferenceChangeListener(self, pcl: PreferenceChangeListener, /) -> None: ...
    def cachedChildren(self) -> java.chaquopy.JavaArray[AbstractPreferences]: ...
    def childSpi(self, arg1: str | java.lang.String, /) -> AbstractPreferences: ...
    def childrenNames(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def childrenNamesSpi(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def clear(self) -> None: ...
    def exportNode(self, os: java.io.OutputStream, /) -> None: ...
    def exportSubtree(self, os: java.io.OutputStream, /) -> None: ...
    def flush(self) -> None: ...
    def flushSpi(self) -> None: ...
    def get(self, key: str | java.lang.String, def_: str | java.lang.String, /) -> str: ...
    def getBoolean(self, key: str | java.lang.String, def_: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    def getByteArray(self, key: str | java.lang.String, def_: java.chaquopy.JavaArrayJByte, /) -> java.chaquopy.JavaArrayJByte: ...
    def getChild(self, nodeName: str | java.lang.String, /) -> AbstractPreferences: ...
    def getDouble(self, key: str | java.lang.String, def_: float | java.jdouble | java.lang.Double, /) -> float: ...
    def getFloat(self, key: str | java.lang.String, def_: float | java.jfloat | java.lang.Float, /) -> float: ...
    def getInt(self, key: str | java.lang.String, def_: int | java.jint | java.lang.Integer, /) -> int: ...
    def getLong(self, key: str | java.lang.String, def_: int | java.jlong | java.lang.Long, /) -> int: ...
    def getSpi(self, arg1: str | java.lang.String, /) -> str: ...
    def isRemoved(self) -> bool: ...
    def isUserNode(self) -> bool: ...
    def keys(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def keysSpi(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def name(self) -> str: ...
    def node(self, path: str | java.lang.String, /) -> Preferences: ...
    def nodeExists(self, path: str | java.lang.String, /) -> bool: ...
    def parent(self) -> Preferences: ...
    def put(self, key: str | java.lang.String, value: str | java.lang.String, /) -> None: ...
    def putBoolean(self, key: str | java.lang.String, value: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def putByteArray(self, key: str | java.lang.String, value: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def putDouble(self, key: str | java.lang.String, value: float | java.jdouble | java.lang.Double, /) -> None: ...
    def putFloat(self, key: str | java.lang.String, value: float | java.jfloat | java.lang.Float, /) -> None: ...
    def putInt(self, key: str | java.lang.String, value: int | java.jint | java.lang.Integer, /) -> None: ...
    def putLong(self, key: str | java.lang.String, value: int | java.jlong | java.lang.Long, /) -> None: ...
    def putSpi(self, arg1: str | java.lang.String, arg2: str | java.lang.String, /) -> None: ...
    def remove(self, key: str | java.lang.String, /) -> None: ...
    def removeNode(self) -> None: ...
    def removeNodeChangeListener(self, ncl: NodeChangeListener, /) -> None: ...
    def removeNodeSpi(self) -> None: ...
    def removePreferenceChangeListener(self, pcl: PreferenceChangeListener, /) -> None: ...
    def removeSpi(self, arg1: str | java.lang.String, /) -> None: ...
    def sync(self) -> None: ...
    def syncSpi(self) -> None: ...
    def toString(self) -> str: ...

class BackingStoreException(java.lang.Exception):
    @typing.overload
    def __init__(self, s: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...

class InvalidPreferencesFormatException(java.lang.Exception):
    @typing.overload
    def __init__(self, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class NodeChangeEvent(java.util.EventObject):
    def __init__(self, parent: Preferences, child: Preferences, /) -> None: ...
    def getChild(self) -> Preferences: ...
    def getParent(self) -> Preferences: ...

class NodeChangeListener(java.util.EventListener):
    def childAdded(self, arg1: NodeChangeEvent, /) -> None: ...
    def childRemoved(self, arg1: NodeChangeEvent, /) -> None: ...

class PreferenceChangeEvent(java.util.EventObject):
    def __init__(self, node: Preferences, key: str | java.lang.String, newValue: str | java.lang.String, /) -> None: ...
    def getKey(self) -> str: ...
    def getNewValue(self) -> str: ...
    def getNode(self) -> Preferences: ...

class PreferenceChangeListener(java.util.EventListener):
    def preferenceChange(self, arg1: PreferenceChangeEvent, /) -> None: ...

class Preferences(java.lang.Object):
    MAX_KEY_LENGTH: typing.ClassVar[int] = ...
    MAX_NAME_LENGTH: typing.ClassVar[int] = ...
    MAX_VALUE_LENGTH: typing.ClassVar[int] = ...
    def __init__(self) -> None: ...
    def absolutePath(self) -> str: ...
    def addNodeChangeListener(self, arg1: NodeChangeListener, /) -> None: ...
    def addPreferenceChangeListener(self, arg1: PreferenceChangeListener, /) -> None: ...
    def childrenNames(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def clear(self) -> None: ...
    def exportNode(self, arg1: java.io.OutputStream, /) -> None: ...
    def exportSubtree(self, arg1: java.io.OutputStream, /) -> None: ...
    def flush(self) -> None: ...
    def get(self, arg1: str | java.lang.String, arg2: str | java.lang.String, /) -> str: ...
    def getBoolean(self, arg1: str | java.lang.String, arg2: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    def getByteArray(self, arg1: str | java.lang.String, arg2: java.chaquopy.JavaArrayJByte, /) -> java.chaquopy.JavaArrayJByte: ...
    def getDouble(self, arg1: str | java.lang.String, arg2: float | java.jdouble | java.lang.Double, /) -> float: ...
    def getFloat(self, arg1: str | java.lang.String, arg2: float | java.jfloat | java.lang.Float, /) -> float: ...
    def getInt(self, arg1: str | java.lang.String, arg2: int | java.jint | java.lang.Integer, /) -> int: ...
    def getLong(self, arg1: str | java.lang.String, arg2: int | java.jlong | java.lang.Long, /) -> int: ...
    @staticmethod
    def importPreferences(is_: java.io.InputStream, /) -> None: ...
    def isUserNode(self) -> bool: ...
    def keys(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def name(self) -> str: ...
    def node(self, arg1: str | java.lang.String, /) -> Preferences: ...
    def nodeExists(self, arg1: str | java.lang.String, /) -> bool: ...
    def parent(self) -> Preferences: ...
    def put(self, arg1: str | java.lang.String, arg2: str | java.lang.String, /) -> None: ...
    def putBoolean(self, arg1: str | java.lang.String, arg2: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def putByteArray(self, arg1: str | java.lang.String, arg2: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def putDouble(self, arg1: str | java.lang.String, arg2: float | java.jdouble | java.lang.Double, /) -> None: ...
    def putFloat(self, arg1: str | java.lang.String, arg2: float | java.jfloat | java.lang.Float, /) -> None: ...
    def putInt(self, arg1: str | java.lang.String, arg2: int | java.jint | java.lang.Integer, /) -> None: ...
    def putLong(self, arg1: str | java.lang.String, arg2: int | java.jlong | java.lang.Long, /) -> None: ...
    def remove(self, arg1: str | java.lang.String, /) -> None: ...
    def removeNode(self) -> None: ...
    def removeNodeChangeListener(self, arg1: NodeChangeListener, /) -> None: ...
    def removePreferenceChangeListener(self, arg1: PreferenceChangeListener, /) -> None: ...
    def sync(self) -> None: ...
    @staticmethod
    def systemNodeForPackage(c: typing.Type[java.lang.Object], /) -> Preferences: ...
    @staticmethod
    def systemRoot() -> Preferences: ...
    def toString(self) -> str: ...
    @staticmethod
    def userNodeForPackage(c: typing.Type[java.lang.Object], /) -> Preferences: ...
    @staticmethod
    def userRoot() -> Preferences: ...

class PreferencesFactory(java.lang.Object):
    def systemRoot(self) -> Preferences: ...
    def userRoot(self) -> Preferences: ...
