Skip to content

Commit

Permalink
Added all passport error types - PassportElementErrorFrontSide, Passp…
Browse files Browse the repository at this point in the history
…ortElementErrorReverseSide, PassportElementErrorSelfie, PassportElementErrorFile, PassportElementErrorFiles, PassportElementErrorTranslationFile, PassportElementErrorTranslationFiles, PassportElementErrorUnspecified
  • Loading branch information
pengrad committed Aug 27, 2018
1 parent d3069ad commit 780686e
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
abstract class PassportElementErrorAbstractFile extends PassportElementError {
private final static long serialVersionUID = 0L;

private final String file_hash;

public PassportElementErrorAbstractFile(String source, String type, String fileHash, String message) {
super(source, type, message);
file_hash = fileHash;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.pengrad.telegrambot.passport;

import java.io.Serializable;

/**
* Stas Parshin
* 30 July 2018
*/
public class PassportElementErrorDataField extends PassportElementError implements Serializable {
public class PassportElementErrorDataField extends PassportElementError {
private final static long serialVersionUID = 0L;

private final String field_name;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorFile extends PassportElementErrorAbstractFile {
private final static long serialVersionUID = 0L;

public PassportElementErrorFile(String type, String fileHash, String message) {
super("file", type, fileHash, message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorFiles extends PassportElementError {
private final static long serialVersionUID = 0L;

private String[] file_hashes;

public PassportElementErrorFiles(String type, String[] fileHashes, String message) {
super("files", type, message);
file_hashes = fileHashes;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorFrontSide extends PassportElementErrorAbstractFile {
private final static long serialVersionUID = 0L;

public PassportElementErrorFrontSide(String type, String fileHash, String message) {
super("front_side", type, fileHash, message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorReverseSide extends PassportElementErrorAbstractFile {
private final static long serialVersionUID = 0L;

public PassportElementErrorReverseSide(String type, String fileHash, String message) {
super("reverse_side", type, fileHash, message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorSelfie extends PassportElementErrorAbstractFile {
private final static long serialVersionUID = 0L;

public PassportElementErrorSelfie(String type, String fileHash, String message) {
super("selfie", type, fileHash, message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorTranslationFile extends PassportElementErrorAbstractFile {
private final static long serialVersionUID = 0L;

public PassportElementErrorTranslationFile(String type, String fileHash, String message) {
super("translation_file", type, fileHash, message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorTranslationFiles extends PassportElementError {
private final static long serialVersionUID = 0L;

private String[] file_hashes;

public PassportElementErrorTranslationFiles(String type, String[] fileHashes, String message) {
super("translation_files", type, message);
file_hashes = fileHashes;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.pengrad.telegrambot.passport;

/**
* Stas Parshin
* 28 August 2018
*/
public class PassportElementErrorUnspecified extends PassportElementError {
private final static long serialVersionUID = 0L;

private String element_hash;

public PassportElementErrorUnspecified(String type, String elementHash, String message) {
super("unspecified", type, message);
element_hash = elementHash;
}
}

0 comments on commit 780686e

Please sign in to comment.