Created
September 11, 2016 14:16
-
-
Save ZhdanRuslan/da7ae2e3934d4abffc54f22763568020 to your computer and use it in GitHub Desktop.
Level 38, Lesson 10, Home 02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level38.lesson10.home02; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface Changelog { | |
Revision[] value(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level38.lesson10.home02; | |
public @interface Date { | |
int year(); | |
int month(); | |
int day(); | |
int hour(); | |
int minute(); | |
int second(); | |
//напиши свой код | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level38.lesson10.home02; | |
public enum Position { | |
JUNIOR, | |
MIDDLE, | |
SENIOR, | |
OTHER | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level38.lesson10.home02; | |
public @interface Revision { | |
int revision(); | |
Date date(); | |
Author[] authors() default {}; | |
String comment() default ""; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level38.lesson10.home02; | |
/* Реализуй аннотации | |
Проект должен компилироваться и выводить аннотацию класса Solution. | |
Класс Solution и его аннотацию не менять. | |
Аннотация Changelog должна быть видна во время выполнения. | |
*/ | |
@Changelog(value = { | |
@Revision( | |
revision = 4089, | |
date = @Date(year = 2011, month = 5, day = 30, hour = 18, minute = 35, second = 18), | |
comment = "Новый файл добавлен"), | |
@Revision( | |
revision = 6018, | |
date = @Date(year = 2013, month = 1, day = 1, hour = 0, minute = 0, second = 1), | |
authors = {@Author(value = "Серега", position = Position.MIDDLE)}, | |
comment = "Фикс багов"), | |
@Revision( | |
revision = 10135, | |
date = @Date(year = 2014, month = 12, day = 31, hour = 23, minute = 59, second = 59), | |
authors = {@Author(value = "Диана", position = Position.OTHER), | |
@Author("Игорь"), | |
@Author(value = "Витек", position = Position.SENIOR)}) | |
}) | |
public class Solution { | |
public static void main(String[] args) { | |
System.out.println(Solution.class.getAnnotation(Changelog.class).toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment