/*
 * Copyright 2000-2016 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.ide.passwordSafe;

import com.intellij.credentialStore.CredentialAttributes;
import com.intellij.credentialStore.Credentials;
import com.intellij.openapi.components.ServiceManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.concurrency.Promise;

public abstract class PasswordSafe implements PasswordStorage {
  @NotNull
  public static PasswordSafe getInstance() {
    return ServiceManager.getService(PasswordSafe.class);
  }

  public abstract void set(@NotNull CredentialAttributes attributes, @Nullable Credentials credentials, boolean memoryOnly);

  public abstract boolean isMemoryOnly();

  @NotNull
  public abstract Promise<Credentials> getAsync(@NotNull CredentialAttributes attributes);

  public abstract boolean isPasswordStoredOnlyInMemory(@NotNull CredentialAttributes attributes, @NotNull Credentials credentials);
}

@@ -631,17 +631,16 @@
 wordSafe
-;
 %0A%0Aimport
@@ -689,17 +689,16 @@
 tributes
-;
 %0Aimport 
@@ -737,17 +737,16 @@
 dentials
-;
 %0Aimport 
@@ -795,94 +795,8 @@
 ager
-;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.jetbrains.annotations.Nullable;
 %0Aimp
@@ -836,18 +836,10 @@
 mise
-;
 %0A%0A
-public 
 abst
@@ -866,18 +866,9 @@
 afe 
-implements
+:
  Pas
@@ -888,72 +888,71 @@
 %7B%0A  
-@NotNull%0A  public static PasswordSafe getInstance() %7B%0A
+companion object %7B%0A    val instance: PasswordSafe%0A  
     
-return
+get() =
  Ser
@@ -990,24 +990,29 @@
 Safe
-.
+::
 class
+.java
 )
-;
 %0A  %7D%0A%0A  
 publ
@@ -1011,86 +1011,107 @@
 %0A%0A  
-public abstract void set(@NotNull CredentialAttributes attributes, @Nullable C
+abstract val isMemoryOnly: Boolean%0A%0A  abstract operator fun set(attributes: CredentialAttributes, c
 rede
@@ -1108,34 +1108,35 @@
 tes, credentials
- c
+: C
 redentials, bool
@@ -1133,17 +1133,10 @@
 ials
+?
 ,
- boolean
  mem
@@ -1146,166 +1146,102 @@
 Only
-);%0A%0A  public abstract boolean isMemoryOnly();%0A%0A  @NotNull%0A  public abstract Promise%3CCredentials%3E getAsync(@NotNull CredentialAttributes attributes);%0A%0A  public
+: Boolean)%0A%0A  abstract fun getAsync(attributes: CredentialAttributes): Promise%3CCredentials%3E%0A%0A 
  abs
@@ -1250,14 +1250,10 @@
 act 
-boolea
+fu
 n is
@@ -1279,24 +1279,27 @@
 nMemory(
-@NotNull
+attributes:
  Credent
@@ -1315,31 +1315,11 @@
 utes
- attributes, @NotNull C
+, c
 rede
@@ -1324,18 +1324,19 @@
 dentials
- c
+: C
 redentia
@@ -1338,12 +1338,20 @@
 entials)
-;
+: Boolean
 %0A%7D%0A

convert PasswordSafe to kotlin