From f714beba106cb988c5e9ded052a01e9d02cda4b3 Mon Sep 17 00:00:00 2001 From: esoe Date: Thu, 20 Oct 2022 14:59:54 +0300 Subject: [PATCH] qq --- .../java/ru/molokoin/AnnotationReseacher.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 files/src/main/java/ru/molokoin/AnnotationReseacher.java diff --git a/files/src/main/java/ru/molokoin/AnnotationReseacher.java b/files/src/main/java/ru/molokoin/AnnotationReseacher.java new file mode 100644 index 0000000..c75329b --- /dev/null +++ b/files/src/main/java/ru/molokoin/AnnotationReseacher.java @@ -0,0 +1,27 @@ +package ru.molokoin; + +import java.lang.annotation.Annotation; + +public class AnnotationReseacher { + public static File getFile(Storage storage){ + Annotation fileAnnotation = storage + .getClass() + .getAnnotation(File.class); + File file = (File)fileAnnotation; + return file; + } + public static void print(Storage storage){ + Annotation fileAnnotation = storage + .getClass() + .getAnnotation(File.class); + File file = (File)fileAnnotation; + System.out.println(file.name()); + System.out.println(file.extension()); + System.out.println(file.size()); + } + public static void main(String[] args) { + Storage storage = new Storage(); + print(storage); + + } +}