Skip to content

Hw 2 - #7

Open
YashinSergey wants to merge 2 commits into
DwarfPorter:masterfrom
YashinSergey:hw_2
Open

Hw 2#7
YashinSergey wants to merge 2 commits into
DwarfPorter:masterfrom
YashinSergey:hw_2

Conversation

@YashinSergey

Copy link
Copy Markdown

No description provided.

import java.time.*;

class ST500Info{
class ST500Info implements MeteoSensor{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мы не должны трогать этот класс, считайте, что этот класс в либе от датчика

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Идея была в написании адаптера, а вы просто прикрутили интерфейс к классу.


@Override
public LocalDateTime getDateTime() {
return LocalDateTime.now();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но даже, если вы пишете такой "карманный адаптер", то дату надо получать от интерфейса SensorTemperature, и компоновать ее в формат интерфейса MeteoSensor


@Override
public int getId() {
return getData().identifier();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А если идентификатор тоже будет равен 1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants