PlainHeader.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Nextcloud - Android Client
  3. *
  4. * SPDX-FileCopyrightText: 2019 Tobias Kaminsky <tobias@kaminsky.me>
  5. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH
  6. * SPDX-License-Identifier: AGPL-3.0-or-later
  7. */
  8. package com.nextcloud.android.sso;
  9. import java.io.IOException;
  10. import java.io.ObjectInputStream;
  11. import java.io.ObjectOutputStream;
  12. import java.io.Serializable;
  13. public class PlainHeader implements Serializable {
  14. private static final long serialVersionUID = 3284979177401282512L;
  15. private String name;
  16. private String value;
  17. PlainHeader(String name, String value) {
  18. this.name = name;
  19. this.value = value;
  20. }
  21. private void writeObject(ObjectOutputStream oos) throws IOException {
  22. oos.writeObject(name);
  23. oos.writeObject(value);
  24. }
  25. private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
  26. name = (String) in.readObject();
  27. value = (String) in.readObject();
  28. }
  29. public String getName() {
  30. return this.name;
  31. }
  32. public String getValue() {
  33. return this.value;
  34. }
  35. }